[Tarantool-patches] [PATCH 1/1] replication: set replica ID before _cluster commit

Cyrill Gorcunov gorcunov at gmail.com
Tue Jul 27 15:13:05 MSK 2021


On Sun, Jul 25, 2021 at 06:53:02PM +0200, Vladislav Shpilevoy wrote:
> Replica registration works via looking for the smallest not
> occupied ID in _cluster and inserting it into the space.
> 
> It works not so good when mvcc is enabled. In particular, if more
> than 1 replica try to register at the same time, they might get
> the same replica_id because don't see changes of each other until
> the registration in _cluster is complete.
> 
> This in the end leads to all replicas failing the registration
> except one with the 'duplicate key' error (primary index in
> _cluster is replica ID).
> 
> The patch makes the replicas occupy their ID before they commit it
> into _cluster. And new replica ID search now uses the replica ID
> map instead of _cluster iterator.
> 
> This way the registration works like before - like MVCC does not
> exist which is fine.
> 
> Part of #5430

I don't see any obvious problems in the patch, so Ack.


More information about the Tarantool-patches mailing list