From: Vladimir Davydov <vdavydov.dev@gmail.com> To: kostja@tarantool.org Cc: tarantool-patches@freelists.org Subject: [PATCH v4 0/3] Replica rejoin Date: Sat, 21 Jul 2018 15:38:11 +0300 [thread overview] Message-ID: <cover.1532175728.git.vdavydov.dev@gmail.com> (raw) After this patch set is applied, an instance will try to detect if it fell too much behind its peers in the cluster and so needs to be rebootstrapped. If it does, it will skip local recovery and instead proceed to bootstrap from a remote master. Old files (xlog, snap) are not deleted during rebootstrap. They will be removed by gc as usual. https://github.com/tarantool/tarantool/issues/461 https://github.com/tarantool/tarantool/commits/dv/gh-461-replica-rejoin Changes in v4: - Rebase on top of the latest 1.10 and remove merged patches. - Log everything that affects rebootstrap decision making. - Rebootstrap an instance only if it can't follow *all* masters, not just *any* of them, as it used to be. v3: https://www.freelists.org/post/tarantool-patches/PATCH-v3-0011-Replica-rejoin Changes in v3: - Remove merged patches, add some new ones. - Rebase on top of the latest 1.10: this required patching gc to make it track vclocks instead of signatures so that it could report the vclock of the oldest xlog stored on the instance. - Follow-up on the recently committed patch for recovery subsystem: add some comments and remove double scanning of the WAL directory. - Introduce a new IPROTO command, IPROTO_REQUEST_STATUS, to be used instead of IPROTO_REQUEST_VOTE; send a map in reply to this command. Rationale: a map is more flexible and can be extended. In particular, we can use the very same message for inquiring the oldest vclock stored on the master to detect if a replica needs to be rejoined, instead of introducing a new IPROTO command, as we did in v2. - Do NOT rebootstrap a replica if it has some data that is absent on the master. Rationale: we don't want to lose ANY data by rejoining a replica; besides, if a replica's vclock is incomparable with the master's, xdir_scan may break. v2: https://www.freelists.org/post/tarantool-patches/PATCH-v2-0011-Replica-rejoin Changes in v2: - Implement rebootstrap support for vinyl engine. - Call recover_remaining_wals() explicitly after recovery_stop_local() as suggested by @kostja. - Add comment to memtx_engine_new() explaining why we need to init INSTANCE_UUID before proceeding to local recovery. v1: https://www.freelists.org/post/tarantool-patches/RFC-PATCH-0012-Replica-rejoin Vladimir Davydov (3): replication: rebootstrap instance on startup if it fell behind vinyl: simplify vylog recovery from backup vinyl: implement rebootstrap support src/box/box.cc | 9 ++ src/box/relay.cc | 3 + src/box/replication.cc | 59 +++++++ src/box/replication.h | 9 ++ src/box/vy_log.c | 190 +++++++++++++++++------ src/box/vy_log.h | 34 ++++ src/errinj.h | 1 + test/box/errinj.result | 6 +- test/replication/replica_rejoin.result | 250 ++++++++++++++++++++++++++++++ test/replication/replica_rejoin.test.lua | 91 +++++++++++ test/vinyl/replica_rejoin.lua | 13 ++ test/vinyl/replica_rejoin.result | 257 +++++++++++++++++++++++++++++++ test/vinyl/replica_rejoin.test.lua | 88 +++++++++++ test/vinyl/suite.ini | 2 +- 14 files changed, 965 insertions(+), 47 deletions(-) create mode 100644 test/replication/replica_rejoin.result create mode 100644 test/replication/replica_rejoin.test.lua create mode 100644 test/vinyl/replica_rejoin.lua create mode 100644 test/vinyl/replica_rejoin.result create mode 100644 test/vinyl/replica_rejoin.test.lua -- 2.11.0
next reply other threads:[~2018-07-21 12:38 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-21 12:38 Vladimir Davydov [this message] 2018-07-21 12:38 ` [PATCH v4 1/3] replication: rebootstrap instance on startup if it fell behind Vladimir Davydov 2018-07-21 12:38 ` [PATCH v4 2/3] vinyl: simplify vylog recovery from backup Vladimir Davydov 2018-07-21 12:38 ` [PATCH v4 3/3] vinyl: implement rebootstrap support 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=cover.1532175728.git.vdavydov.dev@gmail.com \ --to=vdavydov.dev@gmail.com \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [PATCH v4 0/3] Replica rejoin' \ /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