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 5C4DD6BD10; Sun, 11 Apr 2021 20:56:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C4DD6BD10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618163771; bh=7X2uu8kcZdEdiqTE7eHzIB2P8b4ZH0aa4AzH56tdiHk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=whMYCqIlNHpWJKTqoQCG4Y6D0CPgLXeqiDMMnyg6Iqh01fxTByY/C7Z/GhrSdqS4e aV1nctvERbsBbdq/ddHaNL9AV/O6p9XIo1kc7rWsGZUPg9lMEc6WS5vn5Pb/ntmlPI d2+aBXrqWs0j0KduIexLQ1fjsLkOOGRCF+MXO6aI= Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (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 742F96BD0C for ; Sun, 11 Apr 2021 20:56:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 742F96BD0C Received: by smtp42.i.mail.ru with esmtpa (envelope-from ) id 1lVeJb-0001Ua-H0; Sun, 11 Apr 2021 20:56:07 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Sun, 11 Apr 2021 20:55:55 +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: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979772AC4B34408C6525182A05F53808504092BAC5F917242C1C7D153BF236926D7BCDF9BEC4444E95C7497A572F44FB96D2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE755C0FA95D075C150EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F72512A705E00D288638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2745CB8D7DE9C968D561A0AC7A76A7499AA867293B0326636D2E47CDBA5A96583C09775C1D3CA48CF53FA85A707D24CADCC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C084ED00A64A654CBE8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B9773580932EF7A30AA8517B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050F140C956E756FBB7ABDB03A3F2A65D472B3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B682BBBAF5DF00056E089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC445111ACDC31F19948E44850EFB5864EA22D7BA270771B54F711613D9837F1DA739C2B6934AE262D3EE7EAB7254005DCED40A8B3992233811F6DABF04D5057A81F728CF7B057D10C7078444BBB7636F62AB936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34128DEC38EFF4BE5ADCFBB990A166C79304C9605F25F66D80A6FBF8AB3C2A8E870C28EC65112F9F371D7E09C32AA3244C4853FD7EC75C27F2F101798127F52098B038C9161EF167A1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXjz3uqod8pbhQk8s94C0C0K X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8A3D5B6EFD694386976C0F986BCB20FC1A67D15A7DB3994E9424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 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" Hey, guys, take a look please. The patchset does not contain the tests yet, I've only tested it manually. I will make a follow up with tests soon. Cyrill, I remember our conversation regarding the first patch and bitfields. I just haven't come up with a better alternative yet. 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 | 166 ++++++++++++++---- 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 | 32 +++- test/replication/election_basic.result | 4 +- test/unit/raft_test_utils.c | 4 +- 23 files changed, 501 insertions(+), 120 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 -- 2.24.3 (Apple Git-128)