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 08E696EC57; Sun, 18 Jul 2021 19:53:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 08E696EC57 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626627213; bh=P7j/B3tpn7W/PZuGMo1pN8A90NS85koqGjGn0qHLKzQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wIOWDwAuahR8xU33y8Rf4j31psNIVdq3fQDvm7CtsmTtMWvLVCj5FaZKISUCYEoD9 dvXqnHVIayJ0NF1k6jWNWmfwu0/7+x7uO8HKEIX69aU9G6Uai0ecrYn00kqZoKLccv U+OlGVMa2fykh3tqVvrO+AImIc06Sbha1uRckTHo= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 518166EC55 for ; Sun, 18 Jul 2021 19:53:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 518166EC55 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1m5A2k-0005NM-C9; Sun, 18 Jul 2021 19:53:30 +0300 To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org Date: Sun, 18 Jul 2021 18:53:24 +0200 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: 4F1203BC0FB41BD941C43E597735A9C3038391AAE5FBFA76FBCFDED1455B43CD182A05F538085040414BD59B5E423F241B335B400A12C0B59252FFCB7775AE51BE4FFFADD1A82347 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73AE72CEE53A788F4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378010A306A5B6F90A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88B5528F7E2B1CBC05207439821C3B6B2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B65D56369A3576CBA5089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBC3D6B4D9834ECA7336583C33F54B5094825B6CF94E743119C2B6934AE262D3EE7EAB7254005DCED3E00E3B59223EED21E0A4E2319210D9B64D260DF9561598F01A9E91200F654B00191F08AA555D0B08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348B409C2D257583DF2A3E3471DEDB732EC97727938381A547EF3A6649CFD8E7E41365BE12D7041A2A1D7E09C32AA3244C9388DA6A16487BAE1AF4DCA0448BB6D25595C85A795C7BAEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj+8+KVR9NZrHAfGMOYZ9EZQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D44659821B0DC45C5A60FA6560C89CA603841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 0/5] Bootstrap voter 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Changes in v2: - Moved 'manual' election mode fix into a separate commit; - Replaced raft_start/stop_candidate() with raft_promote/restore(); - Renamed ballot.can_be_leader to ballot.can_lead. Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-6018-boot-voter Issue: https://github.com/tarantool/tarantool/issues/6018 Vladislav Shpilevoy (5): replication: introduce ballot.can_lead box: save box_raft() into a variable raft: replace raft_start_candidate with _promote election: during bootstrap prefer candidates election: promote 'manual' bootstrap master .../unreleased/gh-6018-election-boot-voter.md | 4 + src/box/box.cc | 74 ++++++----- src/box/errcode.h | 2 +- src/box/iproto_constants.h | 1 + src/box/raft.c | 58 +++++++-- src/box/raft.h | 4 +- src/box/replication.cc | 11 +- src/box/xrow.c | 14 ++- src/box/xrow.h | 2 + src/lib/raft/raft.c | 98 ++++++++------- src/lib/raft/raft.h | 13 +- test/box/error.result | 2 +- .../gh-6018-election-boot-voter.result | 116 ++++++++++++++++++ .../gh-6018-election-boot-voter.test.lua | 59 +++++++++ test/replication/gh-6018-master.lua | 17 +++ test/replication/gh-6018-replica.lua | 15 +++ test/replication/suite.cfg | 1 + test/unit/raft.c | 41 ++++--- test/unit/raft.result | 22 ++-- test/unit/raft_test_utils.c | 17 +-- test/unit/raft_test_utils.h | 16 +-- 21 files changed, 438 insertions(+), 149 deletions(-) create mode 100644 changelogs/unreleased/gh-6018-election-boot-voter.md create mode 100644 test/replication/gh-6018-election-boot-voter.result create mode 100644 test/replication/gh-6018-election-boot-voter.test.lua create mode 100644 test/replication/gh-6018-master.lua create mode 100644 test/replication/gh-6018-replica.lua -- 2.24.3 (Apple Git-128)