[Tarantool-patches] [PATCH v2 2/2] xrow: reset parameters of decode_subscribe() to default

Serge Petrenko sergepetrenko at tarantool.org
Mon Sep 6 11:06:34 MSK 2021



03.09.2021 00:47, Vladislav Shpilevoy пишет:
> Hi! Thanks for the fixes!
>
> Now you can drop:
>
> 	applier.cc:1256: cluster_id = uuid_nil;
> 	applier.cc:1292: vclock_create(&applier->remote_vclock_at_subscribe);
>
> 	box.cc:2617: instance_uuid = uuid_nil;
> 	box.cc:2850: replica_uuid = uuid_nil;
> 	box.cc:2851: peer_replicaset_uuid = uuid_nil;
> 	box.cc:2854: vclock_create(&replica_clock);
>
> 	relay.cc:687: vclock_create(&relay->recv_vclock);
Hi!

Ok:

diff --git a/src/box/applier.cc b/src/box/applier.cc
index 9256078e1..b981bd436 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -1289,7 +1289,6 @@ applier_subscribe(struct applier *applier)
           * the replica, and replica has to check whether
           * its and master's cluster ids match.
           */
- vclock_create(&applier->remote_vclock_at_subscribe);
          xrow_decode_subscribe_response_xc(&row, &cluster_id,
                      &applier->remote_vclock_at_subscribe);
          applier->instance_id = row.replica_id;
diff --git a/src/box/box.cc b/src/box/box.cc
index 2c8113cbb..c5797fe58 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -2614,7 +2614,7 @@ box_process_register(struct ev_io *io, struct 
xrow_header *header)
  {
      assert(header->type == IPROTO_REGISTER);

-    struct tt_uuid instance_uuid = uuid_nil;
+    struct tt_uuid instance_uuid;
      struct vclock replica_vclock;
      xrow_decode_register_xc(header, &instance_uuid, &replica_vclock, 
NULL);

@@ -2740,8 +2740,8 @@ box_process_join(struct ev_io *io, struct 
xrow_header *header)
      assert(header->type == IPROTO_JOIN);

      /* Decode JOIN request */
-    struct tt_uuid instance_uuid = uuid_nil;
-    uint32_t replica_version_id = 0;
+    struct tt_uuid instance_uuid;
+    uint32_t replica_version_id;
      xrow_decode_join_xc(header, &instance_uuid, &replica_version_id);

      /* Check that bootstrap has been finished */
@@ -2847,11 +2847,10 @@ box_process_subscribe(struct ev_io *io, struct 
xrow_header *header)
      if (!is_box_configured)
          tnt_raise(ClientError, ER_LOADING);

-    struct tt_uuid replica_uuid = uuid_nil;
-    struct tt_uuid peer_replicaset_uuid = uuid_nil;
+    struct tt_uuid replica_uuid;
+    struct tt_uuid peer_replicaset_uuid;
      struct vclock replica_clock;
      uint32_t replica_version_id;
-    vclock_create(&replica_clock);
      bool anon;
      uint32_t id_filter;
      xrow_decode_subscribe_xc(header, &peer_replicaset_uuid, &replica_uuid,
diff --git a/src/box/relay.cc b/src/box/relay.cc
index 2947468ba..f5852df7b 100644
--- a/src/box/relay.cc
+++ b/src/box/relay.cc
@@ -683,8 +683,6 @@ relay_reader_f(va_list ap)
              struct xrow_header xrow;
              coio_read_xrow_timeout_xc(&io, &ibuf, &xrow,
                      replication_disconnect_timeout());
-            /* vclock is followed while decoding, zeroing it. */
-            vclock_create(&relay->recv_vclock);
              xrow_decode_vclock_xc(&xrow, &relay->recv_vclock);
              /*
               * Replica send us last replicated transaction

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list