[Tarantool-patches] [PATCH v2] replication: fix join vclock obtainment in relay_initial_join
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Oct 29 00:09:45 MSK 2019
Hi! Thanks for the fixes!
> diff --git a/src/box/relay.cc b/src/box/relay.cc
> index e849fcf4f..d16cd1a56 100644
> --- a/src/box/relay.cc
> +++ b/src/box/relay.cc
> @@ -306,13 +306,14 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock)
> });
>
> /*
> - * Sync WAL to make sure that all changes visible from
> - * the frozen read view are successfully committed.
> + * Make sure that current database state is flushed to
> + * the WAL and obtain corresponding vclock.
> */
> - if (wal_sync() != 0)
> + struct wal_checkpoint checkpoint;
> + if (wal_begin_checkpoint(&checkpoint) != 0)
> diag_raise();
>
> - vclock_copy(vclock, &replicaset.vclock);
> + vclock_copy(vclock, &checkpoint.vclock);
It looks wrong, that we do begin_checkpoint() but omit
commit_checkpoint(). I would call commit too. Probably now
begin() does not allocate any resources, but it may start
in future, and we will have a leak here.
More information about the Tarantool-patches
mailing list