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 940F96F87A; Fri, 16 Apr 2021 19:13:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 940F96F87A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618589624; bh=ZszvFY3Re+JKE0pit8QLQpZan5Y6Tjn+3zTBTzlqsuA=; 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=grzBbumMeMby5w3x2LxcRLgiz/QUq94O0YFfaHY1W8d8DYuaI6eIktQTIXfILWOnh Py40x3XWKFSWobzYOnA5J+c0GNdBo5/G5SE0sF30htCmcLD+cIbE31fLyzmGz5Jz7N mjK3VTYZM+vTa50pU+b1wZkqFxRtASH6JqnFh7mU= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 8FD7A6F87A for ; Fri, 16 Apr 2021 19:13:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8FD7A6F87A Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1lXR6E-0005xB-Td; Fri, 16 Apr 2021 19:13:43 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <8bc83a40-710e-0e11-7e3a-f7abcc49846d@tarantool.org> Message-ID: <2122e035-5244-82c7-2058-7b7b398daf68@tarantool.org> Date: Fri, 16 Apr 2021 19:13:42 +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: <8bc83a40-710e-0e11-7e3a-f7abcc49846d@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979723F2FB4628545A35182A05F538085040B976A4C28B1FE2C87FF525E98A9F496F4CCBDB3CAFB811D2E1A4DD9013275E6B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE721810386143EB795EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A8691684BB8CCFB18638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B29FB271A5A352F71E64071F15BA2F6CF079373A8315E4CF65D2E47CDBA5A96583C09775C1D3CA48CFCA5A41EBD8A3A0199FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3CA5A41EBD8A3A0199FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE71AFC29E86C7C7FB7D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C064AB6FBC76952BFCCD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3CE9959E2676FD87735872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5CF4DE3FE3BD5D648D96E43E8BF558F8FD5BFBA3218C5E15FD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AC6E62257D6CD1C9D55909D6533ABF3D0B6767601DC59C388D3E979F58569329422833D80046741E1D7E09C32AA3244CE85D6A678CFEAD310C056A18D312A51DD9ADFF0C0BDB8D1FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3S6P1v0GIqSJJZQcG/YOqA== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8B49540D97199D3745B290DFFBB148378DC3D13817423D1F4424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 10/10] box.ctl: rename clear_synchro_queue to promote 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 02:31, Vladislav Shpilevoy пишет: > Thanks for the patch! > >> diff --git a/test/replication/election_basic.result b/test/replication/election_basic.result >> index d5320b3ff..78c911245 100644 >> --- a/test/replication/election_basic.result >> +++ b/test/replication/election_basic.result >> @@ -108,6 +108,31 @@ assert(box.info.election.leader == box.info.id) >> | - true >> | ... >> >> +-- Manual election mode. A voter most of the time, a leader once >> +-- `box.ctl.promote()` is called. >> +box.cfg{election_mode = 'manual'} >> + | --- >> + | ... >> + >> +assert(box.info.election.state == 'follower') >> + | --- >> + | - true >> + | ... >> +term = box.info.election.term >> + | --- >> + | ... >> +box.ctl.promote() >> + | --- >> + | ... >> +assert(box.info.election.state == 'leader') >> + | --- >> + | - error: assertion failed! >> + | ... >> +assert(box.info.election.term > term) >> + | --- >> + | - error: assertion failed! > Hm. Shouldn't these assertions pass? Ouch. Yes, they should. The assertions failed because promote does nothing when node was a leader in this term. So we can't test box.ctl.promote() with one instance. The test will fail as long as the instance already was the leader in current term. And this is the only case when there is only one instance in test. Even if I move election_mode='manual' above the election_mode='candidate', the same test will fail on conf='vinyl'. =============================== diff --git a/test/replication/election_basic.result b/test/replication/election_basic.result index 78c911245..d5320b3ff 100644 --- a/test/replication/election_basic.result +++ b/test/replication/election_basic.result @@ -108,31 +108,6 @@ assert(box.info.election.leader == box.info.id)   | - true   | ... --- Manual election mode. A voter most of the time, a leader once --- `box.ctl.promote()` is called. -box.cfg{election_mode = 'manual'} - | --- - | ... - -assert(box.info.election.state == 'follower') - | --- - | - true - | ... -term = box.info.election.term - | --- - | ... -box.ctl.promote() - | --- - | ... -assert(box.info.election.state == 'leader') - | --- - | - error: assertion failed! - | ... -assert(box.info.election.term > term) - | --- - | - error: assertion failed! - | ... -  box.cfg{ \      election_mode = 'off',                                                      \      election_timeout = old_election_timeout                                     \ diff --git a/test/replication/election_basic.test.lua b/test/replication/election_basic.test.lua index 5fc398848..821f73cea 100644 --- a/test/replication/election_basic.test.lua +++ b/test/replication/election_basic.test.lua @@ -39,16 +39,6 @@ assert(box.info.election.term > term)  assert(box.info.election.vote == box.info.id)  assert(box.info.election.leader == box.info.id) --- Manual election mode. A voter most of the time, a leader once --- `box.ctl.promote()` is called. -box.cfg{election_mode = 'manual'} - -assert(box.info.election.state == 'follower') -term = box.info.election.term -box.ctl.promote() -assert(box.info.election.state == 'leader') -assert(box.info.election.term > term) -  box.cfg{ \      election_mode = 'off',                                                      \      election_timeout = old_election_timeout                                     \ -- Serge Petrenko