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.96) (envelope-from ) id 1vg6iT-008K6Q-2m for pgsql-pkg-debian@arkaria.postgresql.org; Wed, 14 Jan 2026 19:39:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vg6iS-00CJkB-2o for pgsql-pkg-debian@arkaria.postgresql.org; Wed, 14 Jan 2026 19:39:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vg6iS-00CJk3-2D for pgsql-pkg-debian@lists.postgresql.org; Wed, 14 Jan 2026 19:39:40 +0000 Received: from goedel.df7cb.de ([2a01:4f8:c013:1d4::1]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vg6iQ-000UCr-1r for pgsql-pkg-debian@lists.postgresql.org; Wed, 14 Jan 2026 19:39:40 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1472:9340:f0ad:fc6e:9c86:f1dc]) by goedel.df7cb.de (Postfix) with ESMTPSA id C941511BB; Wed, 14 Jan 2026 19:39:35 +0000 (UTC) Date: Wed, 14 Jan 2026 20:39:35 +0100 From: Christoph Berg To: Laurenz Albe Cc: pgsql-pkg-debian@lists.postgresql.org Subject: Re: pg_upgradecluster and synchronous replication Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Laurenz Albe > vacuumdb ... --analyze-in-stages --missing-stats-only > > processing hung, because the synchronous standby was not available and the transaction > could not commit. Interesting find, thanks for sharing. > Yet I wonder if pg_upgradecluster could improve things by disabling synchronous_standby_names > when the cluster ist started for the "finish" stage. I have attached a POC patch how this > could be done. I didn't test it, and my Perl skills are marginal, but you get the idea. That's also the command that does the final cluster start for production, I wouldn't want such a change to persist. Maybe we should instead change the analyze hook script to do that internally? Setting PGOPTIONS should be enough: PGOPTIONS="-csynchronous_commit=local" > Perhaps this is too much black magic, not sure. But I wanted to share my experience. There is already some code in pg_upgradecluster that works around black magic problems: # ensure we can upgrade DBs with default read-only transactions $ENV{PGOPTIONS} .= " -cdefault_transaction_read_only=off"; This would just add one more wart of that kind. Christoph