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 3F90069013; Wed, 14 Apr 2021 17:17:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3F90069013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618409843; bh=3Ei0bN4xkZGLRezsMC1VDewMl+vlzL66t7ZtXFryqWM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Vc5FinZ6eR3r6vIXK05ZSgU2lZGow+i+L45+VHgnuS/puE5JwLZIAbrx8iF7GL9y9 z8iQX3bYFMUtr6xJw06mzKlg9u5r0fx2zIRc2ZqkRGUFLWYJJajv87VXfiOoPHTNo5 XWPSNZQDDZvlURQubn6GI44BTwv36S76EVYm8tYU= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 A1FED6BD23 for ; Wed, 14 Apr 2021 17:17:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A1FED6BD23 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1lWgKW-000456-QG; Wed, 14 Apr 2021 17:17:21 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Wed, 14 Apr 2021 17:17:10 +0300 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E74806859AC5FE18436AEED970E897805ADA4182A05F538085040878D0BD6A9AD6C99A7AC6C1781FC42184780719F8DFBAF98F3DBCAAC017929DE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE779AAD18609327F83EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E1AAA91777E61F958638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B275F32DBE1342D6C607FA92DB4899043398738A72DB41484ED2E47CDBA5A96583C09775C1D3CA48CF4964A708C60C975A117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7820CF4CC0E318EFB9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE77A2C488DB5AA8911D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0D2B6B67CB21740ACCD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3C9EEE74C166EF7BC35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C978317776011BB17C354FA3BF5431196D8D52 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC445111ACDC31F19948B69F9342289A40B3D938A095F7307605037F972996FEA8359C2B6934AE262D3EE7EAB7254005DCED41D154D92801BDF11E0A4E2319210D9B64D260DF9561598F01A9E91200F654B02DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3455049D7B43D89D645142E30836F516F9F51C742CEF53F4573488913D4C4F8D241BB6681516C73BFA1D7E09C32AA3244CEF65910B6B52D441AB2BB0995782EC1030363D8B7DA7DD44927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrcJA+pXcDumHHB7RnVLKTA== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F832D6326595065D5C092AA9E3E3BD221046DDA3E9626043AC424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v3 00/10] raft: introduce manual elections and fix a bug with re-applying rolled back transactions 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 v3: - fix gh-5445-leader-inconsistency.test.lua flakiness - fixes as per review from Cyrill Gorcunov - minor fixes and rewordings - rebased on top of current master - added patch 9/10 (remove parameter from clear_synchro_queue) Changes in v2: - Added tests for patches 1, 6, 9 - Minor typo fixes and bugfixes. https://github.com/tarantool/tarantool/tree/sp/gh-5445-election-fixes https://github.com/tarantool/tarantool/issues/5445 https://github.com/tarantool/tarantool/issues/3055 Serge Petrenko (10): wal: enrich row's meta information with sync replication flags xrow: introduce a PROMOTE entry box: actualise iproto_key_type array box: make clear_synchro_queue() write a PROMOTE entry instead of CONFIRM + ROLLBACK box: write PROMOTE even for empty limbo raft: keep track of greatest known term and filter replication sources based on that replication: introduce a new election mode: "manual" Support manual elections in `box.ctl.clear_synchro_queue()` box: remove parameter from clear_synchro_queue box.ctl: rename clear_synchro_queue to promote changelogs/unreleased/box-ctl-promote.md | 8 + ...very => qsync-multi-statement-recovery.md} | 0 changelogs/unreleased/raft-promote.md | 4 + src/box/applier.cc | 28 ++ src/box/box.cc | 165 ++++++++-- src/box/box.h | 2 +- src/box/errcode.h | 3 + src/box/iproto_constants.c | 58 ++++ src/box/iproto_constants.h | 31 +- src/box/journal.h | 2 + src/box/lua/ctl.c | 8 +- src/box/raft.c | 37 ++- src/box/raft.h | 20 ++ src/box/txn.c | 9 + src/box/txn_limbo.c | 81 ++--- src/box/txn_limbo.h | 17 +- src/box/wal.c | 24 +- src/box/xrow.c | 68 +++- src/box/xrow.h | 64 +++- src/lib/raft/raft.c | 13 +- src/lib/raft/raft.h | 48 ++- test/box/error.result | 3 + test/replication/election_basic.result | 29 +- test/replication/election_basic.test.lua | 10 + .../gh-3055-election-promote.result | 105 +++++++ .../gh-3055-election-promote.test.lua | 43 +++ .../gh-5445-leader-inconsistency.result | 291 ++++++++++++++++++ .../gh-5445-leader-inconsistency.test.lua | 128 ++++++++ test/replication/suite.cfg | 2 + test/unit/raft_test_utils.c | 4 +- test/unit/xrow.cc | 104 +++++-- test/unit/xrow.result | 133 +++++++- 32 files changed, 1380 insertions(+), 162 deletions(-) create mode 100644 changelogs/unreleased/box-ctl-promote.md rename changelogs/unreleased/{qsync-multi-statement-recovery => qsync-multi-statement-recovery.md} (100%) create mode 100644 changelogs/unreleased/raft-promote.md create mode 100644 test/replication/gh-3055-election-promote.result create mode 100644 test/replication/gh-3055-election-promote.test.lua create mode 100644 test/replication/gh-5445-leader-inconsistency.result create mode 100644 test/replication/gh-5445-leader-inconsistency.test.lua -- 2.24.3 (Apple Git-128)