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 A3F5E70349; Fri, 22 Oct 2021 01:07:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A3F5E70349 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1634854028; bh=nsbQ3evKIbZGvNMelR4ZgnxNEtWdOZEnmtsKvt5Lv6M=; 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=mvvzMwycPbsRB1MT+K6VTCKxCEmO53CVxXAiSnh3aaugIlDMHq3irWqjOylpBZfyo 1dcyxaB6IPqDT3AO425+nQbCsy/h/sRwPJ4DXoE+A3zpih3Qml+HFklQm99u7d7jBI JpoiyjQ8b2A5o+xpvCYRv7lHOoFGhVYE745SSBf8= Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 7BB2A7105C for ; Fri, 22 Oct 2021 01:06:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7BB2A7105C Received: by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1mdgCQ-0000Og-Rv; Fri, 22 Oct 2021 01:06:11 +0300 Message-ID: Date: Fri, 22 Oct 2021 00:06:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: Cyrill Gorcunov , tml References: <20211014215622.49732-1-gorcunov@gmail.com> <20211014215622.49732-4-gorcunov@gmail.com> In-Reply-To: <20211014215622.49732-4-gorcunov@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9C7814344C8C501C81DF2D982FCC3642A10B25E0CD3D2314B182A05F5380850401B4D3F45A62814E98970C29D3EA0FFA0D877AE34265D5B945ECCBD80B883C369 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74D17545F5C3BFD9CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D6424E594306CB78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8DF2CD55C603D89B116BE6571CA8FFB97117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B1593CA6EC85F86D618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE1B544F03EFBC4D5732F3B5D5B27460C0D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3E3786DD2C77EBDAAC0837EA9F3D19764C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006377AA2284B41911753EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D6FCB372DF57C6C43A8CF90CE52C161CF X-C1DE0DAB: 0D63561A33F958A5B5F128041EA8A705D47FF23BA167830BAA39DD4E0B16F1D2D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FA7FF33AA1A4D21C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FA5A4D623E7343BB874952DE71E694BB1FFB340C9644475953BF223DD19539B7308AD56FAEE5779C1D7E09C32AA3244C6FCCEB6B8DC5DC4ED51ABF9965C9421E60759606DA2E136A729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojXelGRflEPnCxrYV0uqfxLg== X-Mailru-Sender: 1F3202E75A95DDEF0AE1703729B258988462B1BDEC572CD93DDBA4F3A530C503ADA57E69902965B207784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v23 3/3] test: add gh-6036-qsync-order test 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" Thanks for the patch! > +-- Make election_replica2 been a leader and start writting data, > +-- the PROMOTE request get queued on election_replica3 and not > +-- yet processed, same time INSERT won't complete either > +-- waiting for PROMOTE completion first. Note that we > +-- enter election_replica3 as well just to be sure the PROMOTE > +-- reached it. > +test_run:switch("election_replica2") > + | --- > + | - true > + | ... > +box.ctl.promote() > + | --- > + | ... > +test_run:switch("election_replica3") > + | --- > + | - true > + | ... > +test_run:wait_cond(function() return box.error.injection.get("ERRINJ_WAL_WRITE_COUNT") > write_cnt end) Sorry, keep the code inside of 80 symbols line width. I added this diff and all the tests passed. That means the only tested parts of the patchset are apply_synchro_row() and txn_limbo_is_replica_outdated(). Please, lets try not to submit more untested code. It is enough that we already have one ticket which simply adds assert(false) into a few places and the tests pass. It does not make the code better, it just adds more uncertainty how it works and whether it works at all. ==================== diff --git a/src/box/box.cc b/src/box/box.cc index 6a9be745a..011738409 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1684,11 +1684,11 @@ box_issue_promote(uint32_t prev_leader_id, int64_t promote_lsn) .lsn = promote_lsn, .term = raft->term, }; - txn_limbo_process_begin(&txn_limbo); + //txn_limbo_process_begin(&txn_limbo); txn_limbo_write_promote(&txn_limbo, req.lsn, req.term); txn_limbo_process_core(&txn_limbo, &req); assert(txn_limbo_is_empty(&txn_limbo)); - txn_limbo_process_commit(&txn_limbo); + //txn_limbo_process_commit(&txn_limbo); } /** A guard to block multiple simultaneous promote()/demote() invocations. */ @@ -1707,12 +1707,12 @@ box_issue_demote(uint32_t prev_leader_id, int64_t promote_lsn) .lsn = promote_lsn, .term = box_raft()->term, }; - txn_limbo_process_begin(&txn_limbo); + //txn_limbo_process_begin(&txn_limbo); txn_limbo_write_demote(&txn_limbo, promote_lsn, box_raft()->term); txn_limbo_process_core(&txn_limbo, &req); assert(txn_limbo_is_empty(&txn_limbo)); - txn_limbo_process_commit(&txn_limbo); + //txn_limbo_process_commit(&txn_limbo); } int diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 9b643072a..ba11443af 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -748,7 +748,7 @@ void txn_limbo_process_core(struct txn_limbo *limbo, const struct synchro_request *req) { - assert(latch_is_locked(&limbo->promote_latch)); + //assert(latch_is_locked(&limbo->promote_latch)); uint64_t term = req->term; uint32_t origin = req->origin_id; @@ -814,9 +814,9 @@ void txn_limbo_process(struct txn_limbo *limbo, const struct synchro_request *req) { - txn_limbo_process_begin(limbo); + //txn_limbo_process_begin(limbo); txn_limbo_process_core(limbo, req); - txn_limbo_process_commit(limbo); + //txn_limbo_process_commit(limbo); } void diff --git a/src/box/txn_limbo.h b/src/box/txn_limbo.h index 0bbd7a1c3..10d20e956 100644 --- a/src/box/txn_limbo.h +++ b/src/box/txn_limbo.h @@ -216,12 +216,12 @@ txn_limbo_is_owner(struct txn_limbo *limbo, uint32_t owner_id) * it rolls back a transaction and updates replication * number causing a nested test for limbo ownership). */ - if (latch_owner(&limbo->promote_latch) == fiber()) - return limbo->owner_id == owner_id; + //if (latch_owner(&limbo->promote_latch) == fiber()) + // return limbo->owner_id == owner_id; - latch_lock(&limbo->promote_latch); + //latch_lock(&limbo->promote_latch); bool v = limbo->owner_id == owner_id; - latch_unlock(&limbo->promote_latch); + //latch_unlock(&limbo->promote_latch); return v; } @@ -249,9 +249,9 @@ txn_limbo_last_entry(struct txn_limbo *limbo) static inline uint64_t txn_limbo_replica_term(struct txn_limbo *limbo, uint32_t replica_id) { - latch_lock(&limbo->promote_latch); + //latch_lock(&limbo->promote_latch); uint64_t v = vclock_get(&limbo->promote_term_map, replica_id); - latch_unlock(&limbo->promote_latch); + //latch_unlock(&limbo->promote_latch); return v; }