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