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 E15EE6F87A; Fri, 16 Apr 2021 19:25:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E15EE6F87A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618590347; bh=std5GpCCQcHS7hD1cCz9hXnLSNIAORuSNFSwuJh0J6k=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iqUhMMsDDFNNJawgGbUT7DY93K6lwOGUShXS12ceiiASubVN+iasL8iDEczZincBc 9FYYkE6nEYOVuY4ri2JozJzglAVmAh4xF5OHHs0oKxAkrdsrW7MRGi2rUegZ+c1NDU vZDrTNiEoGyfYD1kfHbQJxErb0nrDB+ts7pZ0TYw= Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 0D08C6F87A for ; Fri, 16 Apr 2021 19:25:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0D08C6F87A Received: by smtp17.mail.ru with esmtpa (envelope-from ) id 1lXRHt-00008e-So; Fri, 16 Apr 2021 19:25:46 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Fri, 16 Apr 2021 19:25:31 +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: 4F1203BC0FB41BD92FFCB8E6708E74806859AC5FE18436AEED970E897805ADA4182A05F5380850402488C8C320C73D1C254A6F8308BE44EB44B114410269BA3A05056DE08F01E547 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F2919D563845004AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E1B356F17606A5B08638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B213EDF2A79F2581A2662CC79C1FF7247E1DC1F2ED7A42611AD2E47CDBA5A96583C09775C1D3CA48CF27ED053E960B195E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77FFCE1C639F4728C9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE77A2C488DB5AA8911D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C056235C9C6E49608FCD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3CE9959E2676FD87735872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC445111ACDC31F19948BF1196BB3248DD4B34F8D89A93BCD4654003F6DF9C54B1429C2B6934AE262D3EE7EAB7254005DCED41D154D92801BDF11E0A4E2319210D9B64D260DF9561598F01A9E91200F654B02DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D16EA493CC1FD9F866312931B0CB6B3D8A1BE7D015A85B2C61027F2A32662AAE614B6D70691210301D7E09C32AA3244CB0FFD3391182E4ADF80968195F94A7DFC3B3ADDA61883BB5927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3S6P1v0GIqTZewxq57VB2Q== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F88BD3238A7C907672883BD0B4CFEE0E31BC892C7A5BCB43B1424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 00/12] 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 v4: - review fixes as per review from Vlad 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 (12): wal: make wal_assign_lsn accept journal entry xrow: 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: filter rows based on known peer terms election: introduce a new election mode: "manual" raft: introduce raft_start/stop_candidate election: support manual elections in 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 | 22 ++ src/box/box.cc | 161 +++++++--- src/box/box.h | 2 +- src/box/errcode.h | 2 + src/box/iproto_constants.c | 58 ++++ src/box/iproto_constants.h | 31 +- src/box/journal.h | 3 + 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 | 85 ++--- src/box/txn_limbo.h | 9 +- src/box/wal.c | 24 +- src/box/xrow.c | 58 ++-- src/box/xrow.h | 61 ++-- src/lib/raft/raft.c | 84 +++-- src/lib/raft/raft.h | 59 ++++ test/box/error.result | 2 + test/replication/election_basic.result | 4 +- .../gh-3055-election-promote.result | 105 +++++++ .../gh-3055-election-promote.test.lua | 43 +++ .../gh-5445-leader-inconsistency.result | 292 ++++++++++++++++++ .../gh-5445-leader-inconsistency.test.lua | 129 ++++++++ test/replication/suite.cfg | 2 + test/unit/raft.c | 66 +++- test/unit/raft.result | 23 +- test/unit/xrow.cc | 104 +++++-- test/unit/xrow.result | 133 +++++++- 32 files changed, 1437 insertions(+), 211 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)