Re: pg_upgrade and logical replication
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Amit Kapila <amit.kapila16@gmail.com>
Date: 2023-04-07T02:28:02Z
Lists: pgsql-hackers
Attachments
Hi, On Thu, Apr 06, 2023 at 04:49:59AM +0000, Hayato Kuroda (Fujitsu) wrote: > Dear Julien, > > > I'm attaching a v3 to fix a recent conflict with pg_dump due to a563c24c9574b7 > > (Allow pg_dump to include/exclude child tables automatically). > > Thank you for making the patch. > FYI - it could not be applied due to recent commits. SUBOPT_* and attributes > in SubscriptionInfo was added these days. Thanks a lot for warning me! While rebasing and testing the patch, I realized that I forgot to git-add a chunk, so I want ahead and added some minimal TAP tests to make sure that the feature and various checks work as expected, also demonstrating that you can safely resume after running pg_upgrade a logical replication setup where only some of the tables are added to a publication, where new rows and new tables are added to the publication while pg_upgrade is running (for the new table you obviously need to make sure that the same relation exist on the subscriber side but that's orthogonal to this patch). While doing so, I also realized that the subscription's underlying replication origin remote LSN is only set after some activity is seen *after* the initial sync, so I also added a new check in pg_upgrade to make sure that all remote origin tied to a subscription have a valid remote_lsn when the new option is used. Documentation is updated to cover that, same for the TAP tests. v4 attached.
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