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 A6E856EC5E; Mon, 12 Apr 2021 22:40:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A6E856EC5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618256425; bh=DKEUOcmScomr6UyYgVCtDiD8kBTki7UtnnrCCNRecN4=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=eym1PYGo+fowSrpGRmX7ZQmLOZ6GOA4t9OT/dtvpNxqdhUfIfaU+cr7aLd2OwnutT pDncQwEF2pMvK12uuUeN8v7vpvb1QUMvrvEEqNDGnmGXCLgexL/ihQQvwYGGBGFIIg tzMVZexwBuoFzp0HU9gQi6VQ5J2kf/n+3z/o8I1k= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 A57FD6EC5B for ; Mon, 12 Apr 2021 22:40:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A57FD6EC5B Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1lW2Q3-0008Az-Ps; Mon, 12 Apr 2021 22:40:24 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Mon, 12 Apr 2021 22:40:13 +0300 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480BE79914FF86F9151AC38CC435EA4A654182A05F53808504058B4040523EC53E26FFEBB35CA34344D715DEC79B760CCDD7E53A41DE92DB212 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728A881FD0F09D355EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AD1E1BF10F09609D8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B278F90DFF66F5CAD30B01CCCA3101667E8F4427C359EA06A0D2E47CDBA5A96583C09775C1D3CA48CFED8438A78DFE0A9E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7850F8B975A76562C9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE775E406D6279F2D37D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C09396AAD6F124525ACD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C30584FF81F342DA0735872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4ADF048BB164F7B76AF2AE6B0F10E2AB739 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC445111ACDC31F19948B69F9342289A40B3080DBF9E5799BC11CFAA1D42D2410B399C2B6934AE262D3EE7EAB7254005DCED41D154D92801BDF11E0A4E2319210D9B64D260DF9561598F01A9E91200F654B02DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34806D3522FB05EB39DD61F193332A89435A34F996D0405E3B96E89EF835131859E86E00881D15E81E1D7E09C32AA3244C0A437BF9B15C433AF3C8CDC16C7093ADB018FE5BB746DCD1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojq8JA+pXcDunvPi/66LvxHg== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8AFCB052CDF231E7BEF24A0FF9EEBA3B4A212271937A0FB8B424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 0/9] 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 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 (9): 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.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 | 22 +- src/box/box.cc | 167 +++++++++--- src/box/box.h | 2 +- src/box/errcode.h | 3 + src/box/iproto_constants.c | 58 +++++ src/box/iproto_constants.h | 27 +- src/box/journal.h | 2 + src/box/lua/ctl.c | 8 +- src/box/raft.c | 31 ++- src/box/raft.h | 20 ++ src/box/txn.c | 5 + src/box/txn_limbo.c | 79 +++--- src/box/txn_limbo.h | 10 +- src/box/wal.c | 26 +- src/box/xrow.c | 43 +++- src/box/xrow.h | 54 +++- 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 | 238 ++++++++++++++++++ .../gh-5445-leader-inconsistency.test.lua | 108 ++++++++ test/replication/suite.cfg | 2 + test/unit/raft_test_utils.c | 4 +- test/unit/xrow.cc | 64 +++-- test/unit/xrow.result | 123 ++++++++- 32 files changed, 1210 insertions(+), 149 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)