From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 1D86640F3AE for ; Thu, 11 Jun 2020 17:57:17 +0300 (MSK) References: <3210e1e6f867cfd1c1f65e05f28a32deae63c172.1591701695.git.sergepetrenko@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 11 Jun 2020 16:57:15 +0200 MIME-Version: 1.0 In-Reply-To: <3210e1e6f867cfd1c1f65e05f28a32deae63c172.1591701695.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 8/8] replication: write and read CONFIRM entries List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , sergos@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org I added a new commmit with a small fix on top of this one: ==================== limbo: remove entry from limbo before txn completion [TO BE SQUASHED INTO THE PREVIOUS COMMIT] This is a port of the previous limbo entry removal commit. Fixes the same problem. diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index f5d14421e..92fc5540e 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -198,7 +198,7 @@ txn_limbo_ack(struct txn_limbo *limbo, uint32_t replica_id, int64_t lsn) assert(limbo->instance_id != REPLICA_ID_NIL); int64_t prev_lsn = vclock_get(&limbo->vclock, replica_id); vclock_follow(&limbo->vclock, replica_id, lsn); - struct txn_limbo_entry *e; + struct txn_limbo_entry *e, *tmp; struct txn_limbo_entry *last_quorum = NULL; rlist_foreach_entry(e, &limbo->queue, in_queue) { if (e->lsn <= prev_lsn) @@ -220,7 +220,8 @@ txn_limbo_ack(struct txn_limbo *limbo, uint32_t replica_id, int64_t lsn) * Wakeup all the entries in direct order as soon * as confirmation message is written to WAL. */ - rlist_foreach_entry(e, &limbo->queue, in_queue) { + rlist_foreach_entry_safe(e, &limbo->queue, in_queue, tmp) { + rlist_del_entry(e, in_queue); fiber_wakeup(e->txn->fiber); if (e == last_quorum) break;