From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 29 Oct 2018 20:15:42 +0300 From: Vladimir Davydov Subject: Re: [PATCH] hot_standby: reflect amount of recovered rows in box.info Message-ID: <20181029171542.da6lvmoyjknp4bdn@esperanza> References: <20181023151540.33936-1-sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181023151540.33936-1-sergepetrenko@tarantool.org> To: Serge Petrenko Cc: tarantool-patches@freelists.org List-ID: On Tue, Oct 23, 2018 at 06:15:40PM +0300, Serge Petrenko wrote: > To be able to switch to hot_standby instance with minimal downtime, we > need to know how far is it behind the primary instance, i.e. up to what > vclock we have recovered. Previously this was impossible because > box.info.vclock always referenced replicaset.vclock, which isn't updated > during hot_standby. > Introduce a pointer to relevant vclock: either recovery vclock (during > local recovery) or replicaset.vclock (at all other times) and use it in > box.info.vclock, box.info.lsn and box.info.signature. > > Closes #3002 > --- > https://github.com/tarantool/tarantool/issues/3002 > https://github.com/tarantool/tarantool/tree/sp/gh-3002-hot-standby-vclock > > src/box/box.cc | 12 +++++++++++- > src/box/box.h | 7 +++++++ > src/box/lua/info.c | 6 +++--- > test/replication/hot_standby.result | 26 ++++++++++++++++++++++++++ > test/replication/hot_standby.test.lua | 10 ++++++++++ > 5 files changed, 57 insertions(+), 4 deletions(-) > > diff --git a/src/box/box.cc b/src/box/box.cc > index c32f731b0..448fe3dcc 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -138,6 +138,8 @@ static struct fiber_pool tx_fiber_pool; > */ > static struct cbus_endpoint tx_prio_endpoint; > > +struct vclock *last_row_vclock = &replicaset.vclock; > + I took a liberty of renaming last_row_vclock to box_vclock. Pushed to 1.10.