From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A181A6EC55; Wed, 14 Jul 2021 21:25:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A181A6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626287149; bh=ER1Z31Sxfp4I+wxzx3w+12aRu9TisHIoXi7QCzDHJlA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=h9deaNFEi6SOKWusan1F2B4sSgjiNaJsmF+DpcPu5n2k6tCOrpHraSOTIUzsZsc+7 gMpTektS5zzJ90n8RidvcolJ5tc/bsY16VLvNe+5P97+0RBoMuzru0zy4IUbcV5uGl TAD9tIm+C4SkkHKXrBbpHR0T5EZr73veD2tXiCno= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5500D6EC55 for ; Wed, 14 Jul 2021 21:25:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5500D6EC55 Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1m3jZr-0007Q7-6q; Wed, 14 Jul 2021 21:25:47 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Wed, 14 Jul 2021 21:25:28 +0300 Message-Id: X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD97BB0EF39AD2B33D52D9CC5C87942E9F1EA2CB6CC9AFB41C2182A05F538085040ED24B62B9046479C3B47098434CBED7A1DCF217C1AC1C1838CE199B730A0FC11 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7182B22A52F94F7DDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637663000D94094A5D68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D86A149C25C552D2765215845207DE54A6117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6D635BA3ABDB36C18089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CE68746B1F2AB10C60CA24FB758E791DF2EB86156B4F26C5B9C2B6934AE262D3EE7EAB7254005DCEDAAE47F5F63E7377292E1F3B950BCE216D137639923C070AB9EC1289D7B63F6F4BDC6A1CF3F042BAD6DF99611D93F60EF08988D4D34163C9D699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34EB7BD66E9101C1008590367E1F59A0D86283CFC30B12F9609780C52A8335D8BC0EB2A2F39741C6E31D7E09C32AA3244C33207E87286CB5723FEE3F3C005FD7BB435BF7150578642F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXjm5ldCwfClY70LjJHf0CXE X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446EB6F8243A55883804A01C350B615D046F19E0EACE16896D1424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 00/16] forbid implicit limbo ownership transition X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Changes in v4: - various cleanups and fixes as per review from Vlad: * refactor box_promote()/box_demote() - reorder the patches for a more logical progression Changes in v3: - change demote() behaviour as discussed with Vlad: * make it work only on the current leader * make it demote the current leader and always bump the term - change how limbo and raft snapshots are sent in response to JOIN: * encode replica's version in JOIN request * introduce a special stage: JOIN_META with raft and limbo snapshots. Send it based on replica's version.\ https://github.com/tarantool/tarantool/issues/5438 https://github.com/tarantool/tarantool/issues/6034 https://github.com/tarantool/tarantool/tree/sp/gh-6034-empty-limbo-transition Serge Petrenko (16): replication: always send raft state to subscribers txn_limbo: fix promote term filtering txn_limbo: persist the latest effective promote in snapshot replication: encode version in JOIN request replication: add META stage to JOIN replication: send latest effective promote in initial join replication: send current Raft term in join response raft: refactor raft_new_term() box: split promote() into reasonable parts box: make promote always bump the term box: make promote on the current leader a no-op box: fix an assertion failure after a spurious wakeup in promote box: allow calling promote on a candidate box: extract promote() settings to a separate method replication: forbid implicit limbo owner transition box: introduce `box.ctl.demote` src/box/applier.cc | 27 +- src/box/box.cc | 435 ++++++++++++------ src/box/box.h | 3 + src/box/errcode.h | 2 + src/box/iproto_constants.h | 12 +- src/box/lua/ctl.c | 9 + src/box/lua/info.c | 4 +- src/box/memtx_engine.c | 32 ++ src/box/raft.c | 48 +- src/box/raft.h | 4 + src/box/relay.cc | 36 +- src/box/relay.h | 4 +- src/box/txn_limbo.c | 90 ++-- src/box/txn_limbo.h | 14 + src/box/xrow.c | 4 +- src/box/xrow.h | 25 +- src/lib/raft/raft.c | 3 +- test/box/alter.result | 2 +- test/box/error.result | 2 + test/replication/election_basic.result | 3 + test/replication/election_basic.test.lua | 1 + test/replication/election_qsync.result | 3 + test/replication/election_qsync.test.lua | 1 + .../gh-3055-promote-wakeup-crash.result | 43 ++ .../gh-3055-promote-wakeup-crash.test.lua | 20 + .../gh-4114-local-space-replication.result | 7 +- .../gh-4114-local-space-replication.test.lua | 4 +- .../gh-5140-qsync-casc-rollback.result | 6 + .../gh-5140-qsync-casc-rollback.test.lua | 2 + .../gh-5144-qsync-dup-confirm.result | 6 + .../gh-5144-qsync-dup-confirm.test.lua | 2 + .../gh-5163-qsync-restart-crash.result | 6 + .../gh-5163-qsync-restart-crash.test.lua | 2 + .../gh-5167-qsync-rollback-snap.result | 6 + .../gh-5167-qsync-rollback-snap.test.lua | 2 + .../gh-5195-qsync-replica-write.result | 10 +- .../gh-5195-qsync-replica-write.test.lua | 6 +- .../gh-5213-qsync-applier-order-3.result | 9 + .../gh-5213-qsync-applier-order-3.test.lua | 3 + .../gh-5213-qsync-applier-order.result | 6 + .../gh-5213-qsync-applier-order.test.lua | 2 + .../replication/gh-5288-qsync-recovery.result | 6 + .../gh-5288-qsync-recovery.test.lua | 2 + .../gh-5298-qsync-recovery-snap.result | 6 + .../gh-5298-qsync-recovery-snap.test.lua | 2 + .../gh-5426-election-on-off.result | 3 + .../gh-5426-election-on-off.test.lua | 1 + .../gh-5433-election-restart-recovery.result | 3 + ...gh-5433-election-restart-recovery.test.lua | 1 + ...sync-clear-synchro-queue-commit-all.result | 3 + ...nc-clear-synchro-queue-commit-all.test.lua | 1 + .../replication/gh-5438-election-state.result | 66 +++ .../gh-5438-election-state.test.lua | 29 ++ test/replication/gh-5440-qsync-ro.result | 133 ------ test/replication/gh-5440-qsync-ro.test.lua | 53 --- .../gh-5446-qsync-eval-quorum.result | 6 + .../gh-5446-qsync-eval-quorum.test.lua | 2 + .../gh-5506-election-on-off.result | 3 + .../gh-5506-election-on-off.test.lua | 1 + .../gh-5566-final-join-synchro.result | 6 + .../gh-5566-final-join-synchro.test.lua | 2 + .../gh-5874-qsync-txn-recovery.result | 6 + .../gh-5874-qsync-txn-recovery.test.lua | 2 + .../gh-6032-promote-wal-write.result | 3 + .../gh-6032-promote-wal-write.test.lua | 1 + .../gh-6034-election-candidate-promote.result | 84 ++++ ...h-6034-election-candidate-promote.test.lua | 42 ++ .../gh-6034-election-promote-bump-term.result | 26 ++ ...h-6034-election-promote-bump-term.test.lua | 12 + .../gh-6034-qsync-limbo-ownership.result | 186 ++++++++ .../gh-6034-qsync-limbo-ownership.test.lua | 68 +++ .../gh-6057-qsync-confirm-async-no-wal.result | 7 + ...h-6057-qsync-confirm-async-no-wal.test.lua | 3 + test/replication/hang_on_synchro_fail.result | 6 + .../replication/hang_on_synchro_fail.test.lua | 2 + test/replication/qsync_advanced.result | 12 + test/replication/qsync_advanced.test.lua | 4 + test/replication/qsync_basic.result | 33 +- test/replication/qsync_basic.test.lua | 16 +- test/replication/qsync_errinj.result | 6 + test/replication/qsync_errinj.test.lua | 2 + test/replication/qsync_snapshots.result | 6 + test/replication/qsync_snapshots.test.lua | 2 + test/replication/qsync_with_anon.result | 6 + test/replication/qsync_with_anon.test.lua | 2 + test/replication/replica_rejoin.result | 77 ++-- test/replication/replica_rejoin.test.lua | 50 +- test/replication/suite.cfg | 6 +- test/unit/raft.c | 15 +- test/unit/raft.result | 3 +- 90 files changed, 1436 insertions(+), 487 deletions(-) create mode 100644 test/replication/gh-3055-promote-wakeup-crash.result create mode 100644 test/replication/gh-3055-promote-wakeup-crash.test.lua create mode 100644 test/replication/gh-5438-election-state.result create mode 100644 test/replication/gh-5438-election-state.test.lua delete mode 100644 test/replication/gh-5440-qsync-ro.result delete mode 100644 test/replication/gh-5440-qsync-ro.test.lua create mode 100644 test/replication/gh-6034-election-candidate-promote.result create mode 100644 test/replication/gh-6034-election-candidate-promote.test.lua create mode 100644 test/replication/gh-6034-election-promote-bump-term.result create mode 100644 test/replication/gh-6034-election-promote-bump-term.test.lua create mode 100644 test/replication/gh-6034-qsync-limbo-ownership.result create mode 100644 test/replication/gh-6034-qsync-limbo-ownership.test.lua -- 2.30.1 (Apple Git-130)