From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 EDA4B42EF5C for ; Fri, 26 Jun 2020 13:58:36 +0300 (MSK) References: <3210e1e6f867cfd1c1f65e05f28a32deae63c172.1591701695.git.sergepetrenko@tarantool.org> <0427f3c8-ed41-6592-a9e7-41dc9836f8d6@tarantool.org> From: Serge Petrenko Message-ID: Date: Fri, 26 Jun 2020 13:58:35 +0300 MIME-Version: 1.0 In-Reply-To: <0427f3c8-ed41-6592-a9e7-41dc9836f8d6@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: ru 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: Vladislav Shpilevoy , sergos@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org 26.06.2020 01:31, Vladislav Shpilevoy пишет: > 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. Yes, it's ok for now. -- Serge Petrenko