From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 4922242EF5C for ; Fri, 26 Jun 2020 01:04:15 +0300 (MSK) References: <3210e1e6f867cfd1c1f65e05f28a32deae63c172.1591701695.git.sergepetrenko@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Fri, 26 Jun 2020 00:04:13 +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 > diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c > index efb97a591..daec98317 100644 > --- a/src/box/txn_limbo.c > +++ b/src/box/txn_limbo.c > @@ -128,12 +128,65 @@ txn_limbo_wait_complete(struct txn_limbo *limbo, struct txn_limbo_entry *entry) > +void > +txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn) > +{ > + assert(limbo->instance_id != REPLICA_ID_NIL && > + limbo->instance_id != instance_id); > + struct txn_limbo_entry *e, *tmp; > + rlist_foreach_entry_safe(e, &limbo->queue, in_queue, tmp) { > + if (e->lsn > lsn) > + break; What if e->lsn is -1, because its LSN wasn't delivered to TX thread from WAL thread yet?