[Tarantool-patches] [PATCH v4 06/16] replication: send latest effective promote in initial join
Sergey Petrenko
sergepetrenko at tarantool.org
Fri Jul 23 10:44:49 MSK 2021
22.07.2021 01:24, Vladislav Shpilevoy пишет:
> Hi! Good job on the patch!
>
>> diff --git a/src/box/relay.cc b/src/box/relay.cc
>> index 4ebe0fb06..4b102a777 100644
>> --- a/src/box/relay.cc
>> +++ b/src/box/relay.cc
>> @@ -442,7 +445,11 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock,
>> row.type = IPROTO_JOIN_META;
>> coio_write_xrow(&relay->io, &row);
>>
>> - /* Empty at the moment. */
>> + char body[XROW_SYNCHRO_BODY_LEN_MAX];
>> + xrow_encode_synchro(&row, body, &req);
>> + row.replica_id = req.replica_id;
>> + row.sync = sync;
> Shouldn't we also attach sync to IPROTO_JOIN_SNAPSHOT and
> IPROTO_JOIN_META? Although I don't see where it is used in
> the applier. But I see it is attached to xrow_encode_vclock
> a bit above.
Yes, indeed. Will it be enough to set sync once only when sending the
vclock?
The field shouldn't be overwritten by anyone.
===========================
diff --git a/src/box/relay.cc b/src/box/relay.cc
index 4b102a777..db1d595e2 100644
--- a/src/box/relay.cc
+++ b/src/box/relay.cc
@@ -448,7 +448,6 @@ relay_initial_join(int fd, uint64_t sync, struct
vclock *vclock,
char body[XROW_SYNCHRO_BODY_LEN_MAX];
xrow_encode_synchro(&row, body, &req);
row.replica_id = req.replica_id;
- row.sync = sync;
coio_write_xrow(&relay->io, &row);
/* Mark the end of the metadata stream. */
===========================
More information about the Tarantool-patches
mailing list