Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] xrow: reset parameters of decode_subscribe() to default
Date: Mon, 6 Sep 2021 11:06:34 +0300	[thread overview]
Message-ID: <4842897f-9df3-4588-9658-0e943c1869d2@tarantool.org> (raw)
In-Reply-To: <d576d783-9ddf-b359-2a0a-996b2eb90ab1@tarantool.org>



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


  reply	other threads:[~2021-09-06  8:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 13:21 [Tarantool-patches] [PATCH v2 0/2] replication: fix uninitialized replica_version_id access Serge Petrenko via Tarantool-patches
2021-09-02 13:21 ` [Tarantool-patches] [PATCH v2 1/2] box: remove unused variable in process_register() Serge Petrenko via Tarantool-patches
2021-09-02 13:21 ` [Tarantool-patches] [PATCH v2 2/2] xrow: reset parameters of decode_subscribe() to default Serge Petrenko via Tarantool-patches
2021-09-02 21:47   ` Vladislav Shpilevoy via Tarantool-patches
2021-09-06  8:06     ` Serge Petrenko via Tarantool-patches [this message]
2021-09-07 21:46       ` Vladislav Shpilevoy via Tarantool-patches
2021-09-02 17:34 ` [Tarantool-patches] [PATCH v2 0/2] replication: fix uninitialized replica_version_id access Cyrill Gorcunov via Tarantool-patches
2021-09-09 10:18 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4842897f-9df3-4588-9658-0e943c1869d2@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/2] xrow: reset parameters of decode_subscribe() to default' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox