Re: pg_upgrade and logical replication
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Michael Paquier <michael@paquier.xyz>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-11-02T05:35:26Z
Lists: pgsql-hackers
Here are some review comments for patch v10-0001 ====== Commit message 1. The chance of being able to do so should be small as pg_upgrade uses its own port and unix domain directory (customizable as well with --socketdir), but just preventing the launcher to start is safer at the end, because we are then sure that no changes would ever be applied. ~ "safer at the end" (??) ====== src/bin/pg_upgrade/server.c 2. + * We don't want the launcher to run while upgrading because it may start + * apply workers which could start receiving changes from the publisher + * before the physical files are put in place, causing corruption on the + * new cluster upgrading to, so setting max_logical_replication_workers=0 + * to disable launcher. */ if (GET_MAJOR_VERSION(cluster->major_version) >= 1700) - appendPQExpBufferStr(&pgoptions, " -c max_slot_wal_keep_size=-1"); + appendPQExpBufferStr(&pgoptions, " -c max_slot_wal_keep_size=-1 -c max_logical_replication_workers=0"); 2a. The comment is one big long sentence. IMO it will be better to break it up. ~ 2b. Add a blank line between this comment note and the previous one. ~~~ 2c. In a recent similar thread [1], they chose to implement a guc_hook to prevent a user from overriding this via the command line option during the upgrade. Shouldn't this patch do the same thing, for consistency? ~~~ 2d. If you do implement such a guc_hook (per #2c above), then should the patch also include a test case for getting an ERROR if the user tries to override that GUC? ====== [1] https://www.postgresql.org/message-id/20231027.115759.2206827438943188717.horikyota.ntt%40gmail.com Kind Regards, Peter Smith. Fujitsu Australia
Commits
-
pg_upgrade: Retrieve subscription count more efficiently.
- 73de50e13e39 17.0 landed
- 364509a2e7f9 18.0 landed
-
Fix random failure in 004_subscription.
- 677a45c4ae16 17.0 landed
-
Fix 004_subscription.pl to allow its usage in --link mode.
- f17529b71097 17.0 landed
-
Allow upgrades to preserve the full subscription's state.
- 9a17be1e244a 17.0 landed
-
Prevent startup of logical replication launcher during pg_upgrade
- 7021d3b17664 17.0 landed