Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJnOy-0004dW-FE for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Aug 2022 02:49:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJnOw-00056I-S4 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Aug 2022 02:49:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJnOw-00053c-GJ for pgsql-hackers@lists.postgresql.org; Fri, 05 Aug 2022 02:49:26 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oJnOs-0007qf-6l for pgsql-hackers@lists.postgresql.org; Fri, 05 Aug 2022 02:49:26 +0000 Received: by mail-pl1-x630.google.com with SMTP id w14so1471827plp.9 for ; Thu, 04 Aug 2022 19:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=EAJdy0EEp3Teddzyyrvy8Tw81bG/Op2jOx1p4w+PRx8=; b=Px53tUwDL6fS4jAsgjOM6ijBF0MjCxJyHgxHZ5yNJHuG+WFRG6VFfdQJYuC2egz0Vb gpJu9/1b6kKd3f3Sya+pWQB/h340KQi4FXPZ4SZ9gWeEfdHYvC6lgqCk8sQ7o+i6vMMU /kygB/Gv3z6kjB5NnmsthKupNzif4YEOV/MybXEEbkQDxYyhDRLbOhp3oN3vRzZ/zbF8 F6nG2fuCsCxxM+HV3JBSdzgJ9qIxu8nGYSm4MkK9DTYeFExq0nOXioKfUxnGjrzD4D4g zWaZi+COPyvLxLeFNwblJ5c2bX9bkktvQ/f4oHTWy6NS8gaGqPHA+oaMtUx8wkLd61in g+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=EAJdy0EEp3Teddzyyrvy8Tw81bG/Op2jOx1p4w+PRx8=; b=tzgeC5/TyQKBXomlGqhuCsTFQ7ASmgsyF4zJpRWNqXvCLWv4bIlcwOqa6eylHi3GI5 FBQ4k0zyU/SpSd9WKStdlcqnc3Z8Z8PiuukuU+PmbV3JugDB7bRNQGKA62sxujTsuzKQ HwGB1T04jqv2Wy7EXPwMRpdw6PEPqq1YP5ayhKabUqaNDsWKu38CGcy2uZVADALk7Q1P lElIf4e2GKh2WP3XIRcuRla9tyfwKBarPnAHf/5IadOZ3+FrD4VWgVjutxRcSMsDWCyX 4hoKicIjxSeCz47PqfjoB230QmrA9SJD07EUQ1xKQzTuz68ABRCE5LYAHkL5Bmrk58Pu b9Nw== X-Gm-Message-State: ACgBeo1GCXQkDcqgAATJME0QuE8W07uTxv8wI65EBNZER4/9TFAJtoCr u/O5ZzVyQhR2LLNGT4BiS5g= X-Google-Smtp-Source: AA6agR74Afruwd17f5EWjEMP6ajHOFQilR/UwxBt7jyLyxiC4Xo6OvSnOAxHT889SckdhwznewUf6g== X-Received: by 2002:a17:903:2301:b0:16e:f916:22b4 with SMTP id d1-20020a170903230100b0016ef91622b4mr4658461plh.52.1659667759793; Thu, 04 Aug 2022 19:49:19 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id c7-20020a634e07000000b0041b3c112b1esm546871pgb.29.2022.08.04.19.49.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 04 Aug 2022 19:49:19 -0700 (PDT) Date: Fri, 05 Aug 2022 11:49:16 +0900 (JST) Message-Id: <20220805.114916.994654810780821553.horikyota.ntt@gmail.com> To: laurenz.albe@cybertec.at Cc: bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org, satyanarlapuram@gmail.com Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication From: Kyotaro Horiguchi In-Reply-To: <9290b55b6ae2b04e002ca9dadadd1cca09461482.camel@cybertec.at> References: <9290b55b6ae2b04e002ca9dadadd1cca09461482.camel@cybertec.at> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Tue, 26 Apr 2022 08:26:59 +0200, Laurenz Albe wrote in > While this may mitigate the problem, I don't think it will deal with > all the cases which could cause a transaction to end up committed locally, > but not on the synchronous standby. I think that only using the full > power of two-phase commit can make this bulletproof. > > Is it worth adding additional complexity that is not a complete solution? I would agree to this. Likewise 2PC, whatever we do to make it perfect, we're left with unresolvable problems at least for now. Doesn't it meet your requirements if we have a means to know the last transaction on the current session is locally committed or aborted? We are already internally managing last committed LSN. I think we can do the same thing about transaction abort and last inserted LSN and we can expose them any way. This is way simpler than the (maybe) uncompletable attempt to fill up the deep gap. regards. -- Kyotaro Horiguchi NTT Open Source Software Center