pg_upgradecluster and synchronous replication - Mailing list pgsql-pkg-debian

From Laurenz Albe
Subject pg_upgradecluster and synchronous replication
Date
Msg-id d3f21029c8ea11f6a61cfb8045ac11480787411e.camel@cybertec.at
Whole thread Raw
Responses Re: pg_upgradecluster and synchronous replication
List pgsql-pkg-debian
I ran into a problem today during a training session when I demonstrated

  pg_upgradecluster -v 18 --method=upgrade --link 17 main

The problem was that I had configured synchronous streaming replication first, so after
pg_upgrade, the synchronous standby was lost, and when pg_upgradecluster ran

  vacuumdb ... --analyze-in-stages --missing-stats-only

processing hung, because the synchronous standby was not available and the transaction
could not commit.

Yes, that was my mistake, and yes, the problem was easily fixed by interrupting
pg_upgradecluster, disabling synchronous_standby_names and running the ANALYZE
and v17 cluster removal manually.

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.

Perhaps this is too much black magic, not sure.  But I wanted to share my experience.

Yours,
Laurenz Albe

Attachment

pgsql-pkg-debian by date:

Previous
From: apt.postgresql.org Repository Update
Date:
Subject: barman updated to version 3.17.0-1.pgdg+1
Next
From: Christoph Berg
Date:
Subject: Re: pg_upgradecluster and synchronous replication