From: Vladimir Davydov <vdavydov.dev@gmail.com> To: kostja@tarantool.org Cc: tarantool-patches@freelists.org Subject: [PATCH] replication: print master uuid when (re)bootstrapping Date: Fri, 27 Jul 2018 19:13:05 +0300 [thread overview] Message-ID: <22b2aeedbb864c72bba29f6985b640e2e8f9413a.1532707725.git.vdavydov.dev@gmail.com> (raw) In-Reply-To: <20180723201911.GB10149@chai> Currently only the remote address is printed. Let's also print the UUID, because replicas are identified by UUID everywhere in tarantool, not by the address. An example of the output is below: I> can't follow eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: required {1: 8} available {1: 12} C> replica is too old, initiating rebootstrap I> bootstrapping replica from eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083 I> can't follow eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: required {1: 17, 2: 1} available {1: 20} I> can't rebootstrap from eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: replica has local rows: local {1: 17, 2: 1} remote {1: 23} I> recovery start Suggested by @kostja. Follow-up ea69a0cd12d8 ("replication: rebootstrap instance on startup if it fell behind"). --- https://github.com/tarantool/tarantool/commits/dv/print-replica-uuid-to-log https://www.freelists.org/post/tarantool-patches/PATCH-v3-0711-replication-rebootstrap-instance-on-startup-if-it-fell-behind,3 src/box/box.cc | 3 ++- src/box/replication.cc | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index ae4959d6..ee12d573 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1703,7 +1703,8 @@ bootstrap_from_master(struct replica *master) applier_resume_to_state(applier, APPLIER_READY, TIMEOUT_INFINITY); assert(applier->state == APPLIER_READY); - say_info("bootstrapping replica from %s", + say_info("bootstrapping replica from %s at %s", + tt_uuid_str(&master->uuid), sio_strfaddr(&applier->addr, applier->addr_len)); /* diff --git a/src/box/replication.cc b/src/box/replication.cc index 48956d2e..26bbbe32 100644 --- a/src/box/replication.cc +++ b/src/box/replication.cc @@ -659,14 +659,15 @@ replicaset_needs_rejoin(struct replica **master) return false; } + const char *uuid_str = tt_uuid_str(&replica->uuid); const char *addr_str = sio_strfaddr(&applier->addr, applier->addr_len); char *local_vclock_str = vclock_to_string(&replicaset.vclock); char *remote_vclock_str = vclock_to_string(&ballot->vclock); char *gc_vclock_str = vclock_to_string(&ballot->gc_vclock); - say_info("can't follow %s: required %s available %s", - addr_str, local_vclock_str, gc_vclock_str); + say_info("can't follow %s at %s: required %s available %s", + uuid_str, addr_str, local_vclock_str, gc_vclock_str); if (vclock_compare(&replicaset.vclock, &ballot->vclock) > 0) { /* @@ -674,9 +675,10 @@ replicaset_needs_rejoin(struct replica **master) * the master. Don't rebootstrap as we don't want * to lose any data. */ - say_info("can't rebootstrap from %s: " + say_info("can't rebootstrap from %s at %s: " "replica has local rows: local %s remote %s", - addr_str, local_vclock_str, remote_vclock_str); + uuid_str, addr_str, local_vclock_str, + remote_vclock_str); goto next; } -- 2.11.0
next prev parent reply other threads:[~2018-07-27 16:13 UTC|newest] Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-14 20:49 [PATCH v3 00/11] Replica rejoin Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 01/11] recovery: clean up WAL dir scan code Vladimir Davydov 2018-07-19 7:08 ` Konstantin Osipov 2018-07-14 20:49 ` [PATCH v3 02/11] xrow: factor out function for decoding vclock Vladimir Davydov 2018-07-19 7:08 ` Konstantin Osipov 2018-07-14 20:49 ` [PATCH v3 03/11] Introduce IPROTO_REQUEST_STATUS command Vladimir Davydov 2018-07-19 7:10 ` Konstantin Osipov 2018-07-19 8:17 ` Vladimir Davydov 2018-07-21 10:25 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 04/11] Get rid of IPROTO_SERVER_IS_RO Vladimir Davydov 2018-07-19 7:10 ` Konstantin Osipov 2018-07-21 12:07 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 05/11] gc: keep track of vclocks instead of signatures Vladimir Davydov 2018-07-19 7:11 ` Konstantin Osipov 2018-07-14 20:49 ` [PATCH v3 06/11] Include oldest vclock available on the instance in IPROTO_STATUS Vladimir Davydov 2018-07-19 7:12 ` Konstantin Osipov 2018-07-21 12:07 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 07/11] replication: rebootstrap instance on startup if it fell behind Vladimir Davydov 2018-07-19 7:19 ` Konstantin Osipov 2018-07-19 10:04 ` Vladimir Davydov 2018-07-23 20:19 ` Konstantin Osipov 2018-07-27 16:13 ` Vladimir Davydov [this message] 2018-07-31 8:34 ` [PATCH] replication: print master uuid when (re)bootstrapping Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 08/11] vinyl: simplify vylog recovery from backup Vladimir Davydov 2018-07-31 8:21 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 09/11] vinyl: pass flags to vy_recovery_new Vladimir Davydov 2018-07-21 11:12 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 10/11] Update test-run Vladimir Davydov 2018-07-21 11:13 ` Vladimir Davydov 2018-07-14 20:49 ` [PATCH v3 11/11] vinyl: implement rebootstrap support Vladimir Davydov 2018-07-31 8:23 ` Vladimir Davydov
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=22b2aeedbb864c72bba29f6985b640e2e8f9413a.1532707725.git.vdavydov.dev@gmail.com \ --to=vdavydov.dev@gmail.com \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [PATCH] replication: print master uuid when (re)bootstrapping' \ /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