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 1C22E6ECE3; Tue, 18 Jan 2022 16:12:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1C22E6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1642511531; bh=0Z1yUNoNo+oKegQYUr74JUEfyMnLRw+l+JWeZFHO8L0=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eY7YLDrQFRbxtzFmVL3p4ekfvfYwqsKBv1txfD8ZuZgM5+8YHE6OAjVGpHtbbQM2a jH8Lt5fwJy3aYtd6b00T3b8Bh4iv0rLJbEZ/BJNZlAMSHBsCrsR4WpFBxiExC31M0M WKKqQfVmyea7JW8ul80Bu1903+M3erXsnZHjJsyE= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (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 BB4E56ECE3 for ; Tue, 18 Jan 2022 16:12:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BB4E56ECE3 Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1n9oHR-00075v-1Y; Tue, 18 Jan 2022 16:12:09 +0300 Message-ID: Date: Tue, 18 Jan 2022 16:12:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <8573bc1d91d28b77c7aa87ebb5fb398c1287fcc0.1642207647.git.v.shpilevoy@tarantool.org> Content-Language: ru In-Reply-To: <8573bc1d91d28b77c7aa87ebb5fb398c1287fcc0.1642207647.git.v.shpilevoy@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9674A2F03CC16047493ECD94FB52240F626AEA9C6EA7B60CE182A05F538085040913634E6B043A9D12A0F124199DA0940906F907D3DFD3C029B53453ED7D24AB4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A609AE8E79ADB41CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375448D590B04CE87D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8375B6481202818BEB01DCE68187B18BA117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DEFCE65BE3358055BDD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE389DDFE3E282F3DD16136E347CC761E07C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5C6F76AFAFED6B4C2030D90786EE406FD7CDCC6B3B8C11623D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348B532EA2091F4FF6DC9376DC40B9BF4351F99E0286BB46EC8C256C5A60F329F0C89FF7ECF7B450311D7E09C32AA3244C015118D97EED4553339F2F84A539994C9CA7333006C390A0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvTjFtNOxqHA61Abaj/DXpA== X-Mailru-Sender: 583F1D7ACE8F49BD7B46BC6C7C9DD5A89A6178E79FC513EC00F4E4BA280DDB65A105CF93465C70F5424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BCB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/4] raft: fix crash on election_timeout reconfig 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 15.01.2022 03:48, Vladislav Shpilevoy пишет: > It used to crash if done during election on a node voted for > anybody, it is a candidate, it doesn't know a leader yet, but has > a WAL write in progress. > > Thus it could only happen if the term was bumped by a message from > a non-leader node and wasn't flushed to the disk yet. > > The patch makes the reconfig check if there is a WAL write in > progress. Then don't do anything. > > Could also check for volatile vote instead of persistent, but it > would create the same problem for the case when started writing > vote for self and didn't finish yet. Reconfig would crash. > --- > .../unreleased/election-timeout-cfg-crash.md | 5 ++ > src/lib/raft/raft.c | 3 +- > test/unit/raft.c | 75 ++++++++++++++++++- > test/unit/raft.result | 16 +++- > 4 files changed, 96 insertions(+), 3 deletions(-) > create mode 100644 changelogs/unreleased/election-timeout-cfg-crash.md > > Good catch! LGTM. -- Serge Petrenko