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 0FAF370358; Wed, 15 Sep 2021 17:52:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0FAF370358 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1631717542; bh=5AqgVUbOQMN8mIst8KjvL092LUWbF5CvRN+RyNbJ/Ek=; 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=uQLop7+4m5E1pMFsBj/Z2ThY31GyuEVUa/wvmRPp89/R6jBI0m34AoK+OCQjcZSA4 EtC6WnokXMz2ruMsFxDz+Cv/u4puWR/hFB2d1d7sF6BBbunyVmJxM6UV8NUg6yhyc2 J58yxTxpY379RysehMwaEPsqi3xSpzrssmGpjmpQ= Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 C3FF57189E for ; Wed, 15 Sep 2021 17:51:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C3FF57189E Received: by mail-lj1-f176.google.com with SMTP id q21so1565695ljj.6 for ; Wed, 15 Sep 2021 07:51:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JJrIO0fVk5QwXPDfwHr/X8v3x27AWjkQgOMWfkfLaI8=; b=fzo8lcZ7romqt+HDAi5NPhbuXdPRW/BcVHX5PfDdbPtgY5/4mMaPWwswk2g2BxACgh eYkNHatkBZXza58N+ei09FvK/IYNVfupTgb7VQt5VGrBpHAnwsiTe/ae4sv1CKDDddwx JCIWDwuCKvl+WeAUkszL2TNTaV92X9i7ZQw0ePZyqy6C3kum2V3lcORfwHC8yKeAUwOD +GPssazuKkqBlsXnYxI4kHg+A7FYTTaNDoJekSnKFGIAmCAcdJiTsGB+nritGWvPPQtR 1+DBSIhxugJzcTFjOT3+WnVALGOH+wioQ2x3lvUYnPw18bPg6HEaGW5PelSPXJsmoNzm Qn7A== X-Gm-Message-State: AOAM532OJLi2ZPK5KuOAGarCzI/nzazh9bGK50AIUQE5Bt09boPkjim1 iOytsmG/RzaeGEiWcNklGEiL+4J9zKA= X-Google-Smtp-Source: ABdhPJwQF/ve0nvB9wS9WNZKw3indGrKsahTz3qepd9jc3UXgeKR2HHpMjK06iLtNx3a+jcQC6MQpg== X-Received: by 2002:a2e:91cc:: with SMTP id u12mr260312ljg.501.1631717485679; Wed, 15 Sep 2021 07:51:25 -0700 (PDT) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id i26sm3222lfl.288.2021.09.15.07.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 07:51:24 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id E6A1E5A0021; Wed, 15 Sep 2021 17:50:48 +0300 (MSK) To: tml Date: Wed, 15 Sep 2021 17:50:46 +0300 Message-Id: <20210915145046.133303-4-gorcunov@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210915145046.133303-1-gorcunov@gmail.com> References: <20210915145046.133303-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v16 3/3] qsync: track confirmed_lsn upon CONFIRM packet 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" While been investigating various cluster split-brain scenarios and trying to gather valid incoming synchro request domains and ranges we've discovered that limbo::confirmed_lsn updated not dense enough to cover our needs. In particular this variable is always updated by a limbo owner upon write of syncro entry (to a journal) while replica just reads such record without confirmed_lsn update, so when the replica become a cluster leader it sends a promote request back to the former leader where the packet carries zero LSN instead of previous confirmed_lsn and validation of such packet won't pass. Note the packet validation is not yet implemented in this patch so it is rather a preparatory work for future. Part-of #6036 Signed-off-by: Cyrill Gorcunov --- src/box/txn_limbo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index eb9aa7780..959811309 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -774,6 +774,20 @@ txn_limbo_process_run(struct txn_limbo *limbo, switch (req->type) { case IPROTO_RAFT_CONFIRM: txn_limbo_read_confirm(limbo, lsn); + /* + * We have to adjust confirmed_lsn according + * to LSN coming from the request. It is because + * we will need to report it as old's limbo owner + * LSN inside PROMOTE requests (if administrator + * or election engine will make us so). + * + * We could update confirmed_lsn on every + * txn_limbo_read_confirm call but this function + * is usually called in a couple with + * txn_limbo_write_confirm, thus to eliminate redundant + * variables update we make so once but explicitly. + */ + limbo->confirmed_lsn = req->lsn; break; case IPROTO_RAFT_ROLLBACK: txn_limbo_read_rollback(limbo, lsn); -- 2.31.1