Re: pg_upgrade and logical replication
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
Amit Kapila <amit.kapila16@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-11-24T01:29:45Z
Lists: pgsql-hackers
I have only trivial review comments for patch v18-0001 ====== src/bin/pg_upgrade/check.c 1. check_new_cluster_subscription_configuration + /* + * A slot not created yet refers to the 'i' (initialize) state, while + * 'r' (ready) state refer to a slot created previously but already + * dropped. These states are supported states for upgrade. The other + * states listed below are not ok: + * + * a) SUBREL_STATE_DATASYNC: A relation upgraded while in this state + * would retain a replication slot, which could not be dropped by the + * sync worker spawned after the upgrade because the subscription ID + * tracked by the publisher does not match anymore. + * + * b) SUBREL_STATE_SYNCDONE: A relation upgraded while in this state + * would retain the replication origin in certain cases. + * + * c) SUBREL_STATE_FINISHEDCOPY: A tablesync worker spawned to work on + * a relation upgraded while in this state would expect an origin ID + * with the OID of the subscription used before the upgrade, causing + * it to fail. + * + * d) SUBREL_STATE_SYNCWAIT, SUBREL_STATE_CATCHUP and + * SUBREL_STATE_UNKNOWN: These states are not stored in the catalog, + * so we need not allow these states. + */ 1a. /while 'r' (ready) state refer to a slot/while 'r' (ready) state refers to a slot/ 1b. /These states are supported states for upgrade./These states are supported for pg_upgrade./ 1c /The other states listed below are not ok./The other states listed below are not supported./ ====== src/bin/pg_upgrade/t/004_subscription.pl 2. +# ------------------------------------------------------ +# Check that pg_upgrade refuses to run in: +# a) if there's a subscription with tables in a state different than +# 'r' (ready) or 'i' (init) state and/or +# b) if the subscription has no replication origin. +# ------------------------------------------------------ /if there's a subscription with tables in a state different than 'r' (ready) or 'i' (init) state and/if there's a subscription with tables in a state other than 'r' (ready) or 'i' (init) and/ ====== 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