From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D8D026EC5F; Mon, 19 Apr 2021 11:38:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D8D026EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618821537; bh=DCwRHgtDQA1EJHOXVK9o1R8SQomp3KRDsSDIwsCav4A=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ySDgx55XAieXGGsYqRXIWt0eKSePOLsfKro3ifxFEOO8MIFhB0196RJXTyofzk65k d4M+KCZPg3JOBGvmlQGhnN0GsS160/x4AUt45dbeNWnHcRoiGdkDApZwoNqte0Grl1 Hbv/re/4LzSWWyykYftXXjK7OT2O8SvoWhsjcWbM= Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8013370157 for ; Mon, 19 Apr 2021 11:38:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8013370157 Received: by mail-lf1-f43.google.com with SMTP id y4so14501897lfl.10 for ; Mon, 19 Apr 2021 01:38:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Au3lAN++iSbmtCjMDapLDsRakwWty6LX9X0Y6lzReUc=; b=oaM+ok9z7JzsDI1pPNPyo7Q/1UhjbMKtYmoSvH4OnAt7FtEbgXKyeIuS4ElPIDI6OE 7uaAlK5PSC5WGWSqpVfdSG752G6j3fDY3ahCDkQqQce+V+iA6NKy+XgvFuoPfzZbqV0K prE13iTEaMlsF92IOse42VxY0EAiQid2IzWptwcyr7IAfmjHpH0u12idhXV/dMjvt8N+ TyjRzdutr4ruxeTvaPQfdFjLBcBP59fWGS6CcV/b3HOSJdLMBBemJ/OcuaGkjdG9DG0J fwHSSvCucwrrMxEAzDhDXBEBCMPV+1yAnGCaNmqthThqzkmfrbW9tn5ZJb8HjgFg18YI mJmQ== X-Gm-Message-State: AOAM533yb6HTEHeqLq8Ayr9BiqripwQkoXGoLNlsCjJj007fsy7SB009 1Ho7JvRV7/rVyiwivYDuvgg/bFOsvkqL/A== X-Google-Smtp-Source: ABdhPJyo9f21JENyOri9GVK3x4U+PhL3JQwRz0YAw5o0efYotJeXbn5XElWHCwc8LwpN7MetQk75yA== X-Received: by 2002:a05:6512:3681:: with SMTP id d1mr8555740lfs.495.1618821479518; Mon, 19 Apr 2021 01:37:59 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id d11sm307017lfv.202.2021.04.19.01.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 01:37:58 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 4B61D560213; Mon, 19 Apr 2021 11:37:22 +0300 (MSK) To: tml Date: Mon, 19 Apr 2021 11:37:19 +0300 Message-Id: <20210419083719.29689-4-gorcunov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210419083719.29689-1-gorcunov@gmail.com> References: <20210419083719.29689-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 3/3] txn_limbo: simplify txn_limbo_ack X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" There is no need to test @confirm_lsn at all because even with value -1 we're to continue iterating the queue. Lets drop it and save a branch. I keep "continue" here to be consistent with other "if"s. Signed-off-by: Cyrill Gorcunov --- src/box/txn_limbo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 2a10bd0ae..227b74764 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -505,8 +505,7 @@ txn_limbo_ack(struct txn_limbo *limbo, uint32_t replica_id, int64_t lsn) */ if (!txn_has_flag(e->txn, TXN_WAIT_ACK)) { assert(e->lsn == -1); - if (confirm_lsn == -1) - continue; + continue; } else if (e->lsn <= prev_lsn) { continue; } else if (++e->ack_count < replication_synchro_quorum) { -- 2.30.2