[Tarantool-patches] [PATCH v4 4/4] replication: do not relay rows coming from a remote instance back to it
Konstantin Osipov
kostja.osipov at gmail.com
Wed Feb 26 13:23:19 MSK 2020
* sergepetrenko <sergepetrenko at tarantool.org> [20/02/26 13:00]:
> From: Serge Petrenko <sergepetrenko at tarantool.org>
>
> We have a mechanism for restoring rows originating from an instance that
> suffered a sudden power loss: remote masters resend the isntance's rows
> received before a certain point in time, defined by remote master vclock
> at the moment of subscribe.
> However, this is useful only on initial replication configuraiton, when
> an instance has just recovered, so that it can receive what it has
> relayed but haven't synced to disk.
> In other cases, when an instance is operating normally and master-master
> replication is configured, the mechanism described above may lead to
> instance re-applying instance's own rows, coming from a master it has just
> subscribed to.
> To fix the problem do not relay rows coming from a remote instance, if
> the instance has already recovered.
>
A comment like this also belongs to the code. Usually the patch
that fixes a bug comes along with a test case for a bug, are you
sure you can't submit one?
> vclock_copy(&vclock, &replicaset.vclock);
> + unsigned int id_mask = box_is_orphan() ? 0 : 1 << instance_id;
box_is_orphan() fits the bill, so it's good enough.
I would explain, however, that what we are really looking for
here is whether or not the local WAL accepts writes. As soon as we
started allowing writes to the local WAL, we don't want to get
these writes from elsewhere.
--
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list