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 935106EC41; Wed, 22 Sep 2021 16:07:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 935106EC41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1632316040; 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=K2GCSwZCwln0JHPxPBNwmv5S+/WUFsGnI/VI9+Vwh8rkR/8F2KcRmzZhfQAXUgJiQ Bvrj6AWxsbiEMUQElaW0AXeXnfPQo9LCy+CQmclYOmmlhWJash9b+msqAuvJEzjosZ AMYEOQe/cAQSXKX1mFTm1F6Ny6SBOQUve9+UgYPA= Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 D59826EC44 for ; Wed, 22 Sep 2021 16:06:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D59826EC44 Received: by mail-lf1-f44.google.com with SMTP id u18so11419874lfd.12 for ; Wed, 22 Sep 2021 06:06:24 -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=yrCortUAm2g07eL1fR7RbakevvrsflkAU/L+5t6o2at7KwvTg9q7kNgqRmMs7Qwe4R wRUUeX9LodaQ2EKzW3Bp87UTcOhroIyi4SIGPtdbL6CdIjGd5OvOBUEtxS29bG/5YmYP mLBO0V+VaNmTZ8OWqwKse5I+DpW0IU4UkzDP32VH4c8Z8EhKKI5lGTG3Nm9nXIsfT0Xq nkfFtgPUUJIzHpIM8Vgd4BBBHPeclYUam3aj7vL2K5IU+XVES2mmKmzK+nLBgSYeUcCG n7uae8P0IhXwH9thKDj95pFADXgCj2semfyWZmO/Qs7OIC99cI54RF81qclAh8rsD2NH NMpw== X-Gm-Message-State: AOAM533kpWOFjtd6BlOpmqSpoIUhhv0vwHonqiu8GjVnPHjEdDsoYiiP B+PORpXcqp9hb33GFIV9qNc+7Tfd+64dRA== X-Google-Smtp-Source: ABdhPJxt1wbznOzT0Aji6B1DXV1dqDPV/FqLmhYl2Qb5sG/nBS+VWsPVojU84nb+m3gFNUKB7ggooA== X-Received: by 2002:a05:6512:2090:: with SMTP id t16mr25779942lfr.119.1632315973114; Wed, 22 Sep 2021 06:06:13 -0700 (PDT) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id r7sm174161lfc.106.2021.09.22.06.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 06:06:12 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 4DEF55A0021; Wed, 22 Sep 2021 16:05:36 +0300 (MSK) To: tml Date: Wed, 22 Sep 2021 16:05:33 +0300 Message-Id: <20210922130535.79479-4-gorcunov@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210922130535.79479-1-gorcunov@gmail.com> References: <20210922130535.79479-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v17 3/5] 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