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 1oL32r-0002Ya-Jn for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Aug 2022 13:43:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oL32q-0005vF-F4 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Aug 2022 13:43:48 +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 1oL32q-0005v6-3x for pgsql-hackers@lists.postgresql.org; Mon, 08 Aug 2022 13:43:48 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oL32n-00061f-QZ for pgsql-hackers@lists.postgresql.org; Mon, 08 Aug 2022 13:43:47 +0000 Received: by mail-lj1-x229.google.com with SMTP id v10so6374280ljh.9 for ; Mon, 08 Aug 2022 06:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=L5GRM9Fdn5ZBEtKfNhgzzTOzsDcWL88KsDuLPssg0WM=; b=M1QmIqbdNe8dbzTMfhKH9Nsmbxtv8YxiLhjd+Ofw/dKbYxkH3CLq8yx8f6ALk4dN/h TGownE6TVmlex1WTYLGsVKhX/5LH5AvSZ4eY2H1gjlCJYOtghUDpChNMeiGPVHlV20K4 /+anmP31tdXjMIQf+9M9Bn9FdknlX6BeAn5a/+1YQp0siCd36r3ix57eeTifCBrF9OEp VeGzl8ews19mtJFLUbSmoA5EkP8GBljfnSlixEq+75Acyvq7xw0uiUFSzDnFS5ftyTI3 ymJf1xXbkuuPU3tojj/kINoAk0J5AnTYn0zF/YOWEuHLsBUG/2YZhWqul4bihYwjjt3g UAvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=L5GRM9Fdn5ZBEtKfNhgzzTOzsDcWL88KsDuLPssg0WM=; b=Ol0HZQ2kQA7iW0ccw3Zw3/GBAuBH+KiqXMct0YcyLlVh+VUaATKZnSn4MqDaejPYIG 1cBdoVr2uZ7toZsumyZ7gkMLm9xtdUzGP8oldP4lU4tP2QA/DseyOrO+/kN9f0buLB1+ QjF8usI3SP2HSbJfYMmc8JTg2OH9Zb6LC7BVxN4HE9tG61u0yMpnvqgIyCaUTayQzE77 VyZIr5gDkrfueP3t+i8wqcgNfCqrbguDSGJblZSid08fwWbpB8qD1UlLdm2eGZ/Ke1nC YefKY3GmMLgI1zHBTYji84lj/PdQ9h77ITygNeFNnLAZR8RtqFN9+C8Oz8oUuxm8ucKS iipw== X-Gm-Message-State: ACgBeo085BLGBL8kTTH3/ZQPVMTZ7mmvYBLaQTZMBYPJes69AOu7sw5l sNODVOfA9JiOq/ksdN52tNCEhBC4Z0fJFNeKVo0= X-Google-Smtp-Source: AA6agR6q2I1OHt2hN1wnAv8qth7povXTCzQdSuhxpBei9xbyCLbkoX82qhvxN2AvIQLJFPG0fqikPpJL+gZn08s8xng= X-Received: by 2002:a2e:80d5:0:b0:25e:6a71:bf27 with SMTP id r21-20020a2e80d5000000b0025e6a71bf27mr5777631ljg.472.1659966223862; Mon, 08 Aug 2022 06:43:43 -0700 (PDT) MIME-Version: 1.0 References: <9290b55b6ae2b04e002ca9dadadd1cca09461482.camel@cybertec.at> <20220805.114916.994654810780821553.horikyota.ntt@gmail.com> In-Reply-To: <20220805.114916.994654810780821553.horikyota.ntt@gmail.com> From: Bharath Rupireddy Date: Mon, 8 Aug 2022 19:13:25 +0530 Message-ID: Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication To: Kyotaro Horiguchi Cc: Laurenz Albe , PostgreSQL Hackers , SATYANARAYANA NARLAPURAM Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Aug 5, 2022 at 8:19 AM Kyotaro Horiguchi wrote: > > 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. There can be more txns that are locally-committed-but-not-yet-replicated. Even if we have that information stored somewhere, what do we do with it? Those txns are committed from the client perspective but not committed from the server's perspective. Can you please explain more about your idea, I may be missing something? -- Bharath Rupireddy RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/