[Tarantool-patches] [PATCH v6 2/3] gc: rely on minimal vclock components instead of signatures

Serge Petrenko sergepetrenko at tarantool.org
Mon Apr 13 13:12:19 MSK 2020


> 11 апр. 2020 г., в 19:04, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> написал(а):
> 
> Hi! Thanks for the answers!

Hi! Thanks for the review!

> 
> gc_add_checkpoint() and gc_consumer_advance() still use sum().
> Is it ok?

gc_add_checkpoint() is fine. It’s ok to compare checkpoints by
signature, they’re in a list in the order of creation, which is the
same as order by vclock signature.

> 
> 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 = gc_tree_next(&gc.consumers, consumer);
        bool update_tree = (next != NULL &&
-                           signature >= vclock_sum(&next->vclock));
+                           vclock_lex_compare(vclock, &next->vclock) >= 0);
 
        if (update_tree)
                gc_tree_remove(&gc.consumers, consumer);


> 
> Please, check all the other vclock_sum() invocations too,
> just in case.

Other cases are fine.

--
Serge Petrenko
sergepetrenko at tarantool.org


More information about the Tarantool-patches mailing list