From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 86F05445320 for ; Sun, 5 Jul 2020 19:05:37 +0300 (MSK) From: Vladislav Shpilevoy References: <38933b569988f89ad124e71e49b460698db5e4a0.1593472477.git.v.shpilevoy@tarantool.org> Message-ID: Date: Sun, 5 Jul 2020 18:05:35 +0200 MIME-Version: 1.0 In-Reply-To: <38933b569988f89ad124e71e49b460698db5e4a0.1593472477.git.v.shpilevoy@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 04/19] replication: make sync transactions wait quorum List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org Applied this diff: ==================== diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 2b4aae477..13cef540f 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -124,10 +124,11 @@ txn_limbo_wait_complete(struct txn_limbo *limbo, struct txn_limbo_entry *entry) { struct txn *txn = entry->txn; assert(entry->lsn > 0); - assert(!txn_has_flag(txn, TXN_IS_DONE)); - assert(txn_has_flag(txn, TXN_WAIT_SYNC)); if (txn_limbo_check_complete(limbo, entry)) goto complete; + + assert(!txn_has_flag(txn, TXN_IS_DONE)); + assert(txn_has_flag(txn, TXN_WAIT_SYNC)); bool cancellable = fiber_set_cancellable(false); while (!txn_limbo_entry_is_complete(entry)) fiber_yield(); ==================== Because if a transaction is already complete, it will have IS_DONE and won't have WAIT_SYNC.