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 DAFA94696C4 for ; Mon, 13 Apr 2020 13:12:20 +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: Date: Mon, 13 Apr 2020 13:12:19 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <2A3984D7-8126-4884-BFCA-E564B76B9B01@tarantool.org> References: <47c0ec5d7a4de7d47351e31211c6eb3a3491f844.1586273440.git.sergepetrenko@tarantool.org> <6336a973-02da-99c9-4942-762f02c2cb6d@tarantool.org> <769253CE-47DB-4FEF-BDB2-046799B15682@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v6 2/3] gc: rely on minimal vclock components instead of signatures 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:04, Vladislav Shpilevoy = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0): >=20 > Hi! Thanks for the answers! Hi! Thanks for the review! >=20 > gc_add_checkpoint() and gc_consumer_advance() still use sum(). > Is it ok? gc_add_checkpoint() is fine. It=E2=80=99s ok to compare checkpoints by signature, they=E2=80=99re in a list in the order of creation, which is = the same as order by vclock signature. >=20 > I see gc_consumer_advance() compares vclocks of two neighbour > consumers using sum() to check tree's invariant, even though > the invariant is not related to sum() anymore. Missed that one too, thanks! diff --git a/src/box/gc.c b/src/box/gc.c index 36b2d7f4e..cbcdf7d12 100644 --- a/src/box/gc.c +++ b/src/box/gc.c @@ -580,7 +580,7 @@ gc_consumer_advance(struct gc_consumer *consumer, = const struct vclock *vclock) */ struct gc_consumer *next =3D gc_tree_next(&gc.consumers, = consumer); bool update_tree =3D (next !=3D NULL && - signature >=3D vclock_sum(&next->vclock)); + vclock_lex_compare(vclock, &next->vclock) >=3D= 0); =20 if (update_tree) gc_tree_remove(&gc.consumers, consumer); >=20 > Please, check all the other vclock_sum() invocations too, > just in case. Other cases are fine. -- Serge Petrenko sergepetrenko@tarantool.org=