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 05E6642EF5C for ; Fri, 26 Jun 2020 01:43:58 +0300 (MSK) From: Vladislav Shpilevoy References: <16c9d1ffb9d09bb2b2f206a23973e2734616c345.1592482315.git.sergepetrenko@tarantool.org> <81acf9b0-5fca-7be5-cd27-73cf45edbb4a@tarantool.org> Message-ID: Date: Fri, 26 Jun 2020 00:43:57 +0200 MIME-Version: 1.0 In-Reply-To: <81acf9b0-5fca-7be5-cd27-73cf45edbb4a@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org On 26/06/2020 00:14, Vladislav Shpilevoy wrote: >> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c >> index a715a136e..c55f5bda1 100644 >> --- a/src/box/txn_limbo.c >> +++ b/src/box/txn_limbo.c >> @@ -191,6 +244,38 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn) >> +void >> +txn_limbo_read_rollback(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_reverse(e, &limbo->queue, in_queue, tmp) { >> + if (e->lsn < lsn) >> + break; > > Shouldn't this be 'continue' instead of 'break'? As I understand rollback, > we need to find entry, *from* which all the entries will be rolled back. > Here it seems that if the oldest entry in the limbo (with the smallest LSN) > is smaller than rollback lsn, we just won't rollback anything. Sorry, didn't notice it is 'foreach reverse'. Not just 'foreach'.