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 4D99D42EF5C for ; Fri, 26 Jun 2020 01:31:11 +0300 (MSK) From: Vladislav Shpilevoy References: <3210e1e6f867cfd1c1f65e05f28a32deae63c172.1591701695.git.sergepetrenko@tarantool.org> Message-ID: <0427f3c8-ed41-6592-a9e7-41dc9836f8d6@tarantool.org> Date: Fri, 26 Jun 2020 00:31:09 +0200 MIME-Version: 1.0 In-Reply-To: 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 On 26/06/2020 00:04, Vladislav Shpilevoy wrote: >> 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? Probably not a bug. At least now. Because txn_limbo_read_confirm() is called on replica only, where LSN is known from master before it is written to local WAL.