From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D9AC74696C3 for ; Mon, 13 Apr 2020 13:12:12 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) From: Serge Petrenko In-Reply-To: <20e2a591-7569-a023-959b-12314e473d5e@tarantool.org> Date: Mon, 13 Apr 2020 13:12:11 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <235EADF0-044F-457E-8610-3442D3337D73@tarantool.org> References: <9DB87F34-3674-4316-BA19-8DA801F4BBE9@tarantool.org> <20e2a591-7569-a023-959b-12314e473d5e@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v6 1/3] replication: omit 0-th vclock component in replication responses List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tml > 11 =D0=B0=D0=BF=D1=80. 2020 =D0=B3., =D0=B2 19:05, Vladislav Shpilevoy = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0): >=20 > Hi! Thanks for the fixes! >=20 > Consider more below and on the branch in a separate commit. Thanks! Squashed. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > diff --git a/src/box/xrow.c b/src/box/xrow.c > index b22390a14..70aeb6a3c 100644 > --- a/src/box/xrow.c > +++ b/src/box/xrow.c > @@ -74,7 +74,7 @@ mp_encode_vclock_ignore0(char *data, const struct = vclock *vclock) > } >=20 > static int > -mp_decode_vclock_ignore_0(const char **data, struct vclock *vclock) > +mp_decode_vclock_ignore0(const char **data, struct vclock *vclock) > { > vclock_create(vclock); > if (mp_typeof(**data) !=3D MP_MAP) > @@ -86,16 +86,12 @@ mp_decode_vclock_ignore_0(const char **data, = struct vclock *vclock) > uint32_t id =3D mp_decode_uint(data); > if (mp_typeof(**data) !=3D MP_UINT) > return -1; > + int64_t lsn =3D mp_decode_uint(data); > /* > * Skip vclock[0] coming from the remote > * instances. > */ > - if (id =3D=3D 0) { > - mp_next(data); > - continue; > - } > - int64_t lsn =3D mp_decode_uint(data); > - if (lsn > 0) > + if (lsn > 0 && id !=3D 0) > vclock_follow(vclock, id, lsn); > } > return 0; > @@ -1254,13 +1250,13 @@ xrow_decode_ballot(struct xrow_header *row, = struct ballot *ballot) > ballot->is_loading =3D mp_decode_bool(&data); > break; > case IPROTO_BALLOT_VCLOCK: > - if (mp_decode_vclock_ignore_0(&data, > - &ballot->vclock) = !=3D 0) > + if (mp_decode_vclock_ignore0(&data, > + &ballot->vclock) !=3D= 0) > goto err; > break; > case IPROTO_BALLOT_GC_VCLOCK: > - if (mp_decode_vclock_ignore_0(&data, > - = &ballot->gc_vclock) !=3D 0) > + if (mp_decode_vclock_ignore0(&data, > + &ballot->gc_vclock) = !=3D 0) > goto err; > break; > default: > @@ -1405,7 +1401,7 @@ xrow_decode_subscribe(struct xrow_header *row, = struct tt_uuid *replicaset_uuid, > case IPROTO_VCLOCK: > if (vclock =3D=3D NULL) > goto skip; > - if (mp_decode_vclock_ignore_0(&d, vclock) !=3D = 0) { > + if (mp_decode_vclock_ignore0(&d, vclock) !=3D 0) = { > xrow_on_decode_err(data, end, = ER_INVALID_MSGPACK, > "invalid VCLOCK"); > =09 > return -1; -- Serge Petrenko sergepetrenko@tarantool.org