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 AF7956EC5F; Mon, 19 Apr 2021 15:47:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AF7956EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618836433; bh=/xUTxlqJQr7FFL8rjQEFaDTHmOVZ/FXlH8RYCH5xzXo=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ZIDff5A/CeCpQtWBTwEo+gMxviu8h7BjAoLfSoXQ1c2UavbIqZs8oi9qOrJgaGYeJ Ug9HX0BlFGSQUCpRZ7Vi9W+esJiLIX62w69rLbS8t4usKrVk1oANLNq5SwEC+mMDN/ uwQWauI2EvkGKE8q5SbC3xIALG+GKYI5sSlwmR2o= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 785826EC5F for ; Mon, 19 Apr 2021 15:47:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 785826EC5F Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1lYTJ0-0005qd-Pz; Mon, 19 Apr 2021 15:47:11 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <9c93119c-0dff-7528-f809-9dd0a4176566@tarantool.org> Date: Mon, 19 Apr 2021 15:47:10 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F53808504052283649B91CDEEA86A28082835B6B37DC07B1873EC675B6216594DA865A71F5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DA26CB0764DFC5B8EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063753275FB77F6A31628638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2CA28D61B112FE7934A4FA8B31F08E4C451ACFDFAE348AC99D2E47CDBA5A96583C09775C1D3CA48CF17B107DEF921CE79117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7328B01A8D746D8839FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE7B853862B28F35DDBD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0CCA08DC4F53F8CD1CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3BE90F13D913F449135872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C9783115E2239EC7A6C1E22240D5316989BD39 X-C1DE0DAB: 0D63561A33F958A5EA7DD41A3723C87F3807D000630670A740AC7148881962E6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34753B45383CEFF2047E999A7C5C646A27FDDE755FD679D2F006375280F110D5753FB56232F7A050CF1D7E09C32AA3244C58C31D5377D9D1A9D3AB4071E08BD8228580396430872480FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojocJA+pXcDukmDkKERQeZ/A== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F85B34578F6C9B19BC31F77176FE6C0D9C4EE8E89AF46CA6FE424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 10/12] election: support manual elections in clear_synchro_queue() 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" 16.04.2021 19:25, Serge Petrenko пишет: Follow-up fixes: ============================= s.petrenko@spetrenko:~/Source/tarantool$ git diff diff --git a/src/box/box.cc b/src/box/box.cc index 797aa86b5..358aedd78 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1521,9 +1521,6 @@ box_clear_synchro_queue(bool try_wait)          */         if (!is_box_configured)                 return 0; -       if (txn_limbo_replica_term(&txn_limbo, instance_id) == box_raft()->term) -               return 0; -         bool run_elections = false;         switch (box_election_mode) { @@ -1535,7 +1532,8 @@ box_clear_synchro_queue(bool try_wait)                          "manual elections");                 return -1;         case ELECTION_MODE_MANUAL: -               assert(box_raft()->state == RAFT_STATE_FOLLOWER); +               if (box_raft()->state == RAFT_STATE_LEADER) +                       return 0;                 run_elections = true;                 try_wait = false;                 break; @@ -1550,6 +1548,10 @@ box_clear_synchro_queue(bool try_wait)                                  "'candidate'", "manual elections");                         return -1;                 } +               if (txn_limbo_replica_term(&txn_limbo, instance_id) == +                   box_raft()->term) +                       return 0; +                 break;         default:                 unreachable(); -- Serge Petrenko