Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t986l-007wTm-PL for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2024 19:23:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t986i-001aOI-SI for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Nov 2024 19:23:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t986i-001aO9-Ha for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2024 19:23:53 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t986g-000gIH-B7 for pgsql-hackers@lists.postgresql.org; Thu, 07 Nov 2024 19:23:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4A7JNlIF3458728; Thu, 7 Nov 2024 14:23:47 -0500 From: Tom Lane To: Amit Kapila cc: shveta malik , "Hayato Kuroda (Fujitsu)" , "Zhijie Hou (Fujitsu)" , "pgsql-hackers@lists.postgresql.org" Subject: Re: [bug fix] prepared transaction might be lost when max_prepared_transactions is zero on the subscriber In-reply-to: References: Comments: In-reply-to Amit Kapila message dated "Wed, 21 Aug 2024 15:27:46 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3458726.1731007427.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Nov 2024 14:23:47 -0500 Message-ID: <3458727.1731007427@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Kapila writes: > On Tue, Aug 20, 2024 at 2:01=E2=80=AFPM shveta malik wrote: >> Looks good to me. Please find backported patches attached. > Pushed. I came across this commit while preparing release notes, and I'm worried about whether it doesn't create more problems than it solves. The intent stated in the thread subject is to prevent an apply worker from advancing past a prepared transaction if the subscriber side doesn't permit prepared transactions. However, it appears to me that the committed patch doesn't permit an apply worker to advance past any failing transaction whatsoever. Was any thought given to how a DBA would get out of such a situation and get replication flowing again? In the prepared-xact case, it's at least clear that you could increase max_prepared_transactions and restart the subscriber installation. In the general case, it's not very obvious that you'd even know what the problem is let alone have an easy way to fix it. In other words: I thought the original design here was to intentionally ignore apply errors and keep going, on the theory that that was better than blocking replication altogether. This commit has reversed that decision, on the strength of little or no discussion AFAICS. Are we really ready to push this into minor releases of stable branches? Is it a good idea even on HEAD? regards, tom lane