[Tarantool-patches] [PATCH v2 7/7] replication: do not ignore replica vclock on register

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Mar 26 23:50:10 MSK 2021


Thanks for the patch!

See 2 comments below.

On 24.03.2021 13:24, Serge Petrenko wrote:
> There was a bug in box_process_register. It decoded replica's vclock but
> never used it when sending the registration stream. So the replica might
> lose the data in range (replica_vclock, start_vclock).

1. Could you please add a test?

> Follow-up #5566
> ---
>  src/box/box.cc | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/box/box.cc b/src/box/box.cc
> index 292a54213..0bcb505a8 100644
> --- a/src/box/box.cc
> +++ b/src/box/box.cc
> @@ -2154,7 +2154,8 @@ box_process_register(struct ev_io *io, struct xrow_header *header)
>  			  "wal_mode = 'none'");
>  	}
>  
> -	struct gc_consumer *gc = gc_consumer_register(&replicaset.vclock,
> +	vclock_reset(&replica_vclock, 0, vclock_get(&replicaset.vclock, 0));

2. xrow_decode_register_xc() already returns the vclock with empty 0
part. Why do you need this reset?

> +	struct gc_consumer *gc = gc_consumer_register(&replica_vclock,
>  				"replica %s", tt_uuid_str(&instance_uuid));
>  	if (gc == NULL)
>  		diag_raise();


More information about the Tarantool-patches mailing list