[PATCH] hot_standby: reflect amount of recovered rows in box.info
Vladimir Davydov
vdavydov.dev at gmail.com
Mon Oct 29 20:15:42 MSK 2018
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.
More information about the Tarantool-patches
mailing list