[RFC PATCH 06/12] box: refactor hot standby recovery

Vladimir Davydov vdavydov.dev at gmail.com
Fri Jun 8 16:30:01 MSK 2018


On Fri, Jun 08, 2018 at 04:15:24PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [18/06/08 11:28]:
> > No, it doesn't. See, even though it removes recover_remaining_wals()
> > from recovery_finalize(), it makes hot_standby_f() call it before
> > returning, so that we will rescan the xlog dir just before leaving
> > hot standby mode:
> 
> This is quite tricky. And I don't see why you need to do it this
> way - why not add recover_remaining_wals to box_init instead,
> where it will be more visible.

Hmm, I guess you're right. I'll move the invocation of
recover_remaining_wals from hot_standby_f to be called right after
recovery_stop_local.

Just so you understand why I'm doing this: if this patch set is applied,
we will init replicaset.vclock before reading snapshot for normal
recovery while in case of hot standby we will also have to promote it
after recovery_stop_local. I want to separate those two paths so that we
don't set replicaset.vclock twice in case of normal recovery.

> 
> > > @@ -490,6 +486,7 @@ hot_standby_f(va_list ap)
> > >  
> > >  		subscription.events = 0;
> > >  	}
> > > +	recover_remaining_wals(r, stream, NULL, true);
> > >  	return 0;



More information about the Tarantool-patches mailing list