Re: [PoC] pg_upgrade: allow to upgrade publisher node
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>,
Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Bruce Momjian <bruce@momjian.us>, Julien Rouhaud <rjuju123@gmail.com>, vignesh C <vignesh21@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2023-09-11T06:18:20Z
Lists: pgsql-hackers
On Mon, Sep 11, 2023 at 11:16 AM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Mon, Sep 11, 2023 at 10:39 AM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > > > 3. > > - with the primary.) Replication slots are not copied and must > > - be recreated. > > + with the primary.) Replication slots on the old standby are not copied. > > + Only logical slots on the primary are migrated to the new standby, > > + and other slots must be recreated. > > > > This paragraph should be rephrased. I mean first stating that > > "Replication slots on the old standby are not copied" and then saying > > Only logical slots are migrated doesn't seem like the best way. Maybe > > we can just say "Only logical slots on the primary are migrated to the > > new standby, and other slots must be recreated." > > > > It is fine to combine these sentences but let's be a bit more > explicit: "Only logical slots on the primary are migrated to the new > standby, and other slots on the old standby must be recreated as they > are not copied." Fine with this. > > 4. > > + /* > > + * Raise an ERROR if the logical replication slot is invalidating. It > > + * would not happen because max_slot_wal_keep_size is set to -1 during > > + * the upgrade, but it stays safe. > > + */ > > + if (*invalidated && SlotIsLogical(s) && IsBinaryUpgrade) > > + elog(ERROR, "Replication slots must not be invalidated during the upgrade."); > > > > Rephrase the first line as -> Raise an ERROR if the logical > > replication slot is invalidating during an upgrade. > > > > I think it would be better to write something like: "The logical > replication slots shouldn't be invalidated as max_slot_wal_keep_size > is set to -1 during the upgrade." This makes it much clear. > > 5. > > + /* Logical slots can be migrated since PG17. */ > > + if (GET_MAJOR_VERSION(old_cluster.major_version) <= 1600) > > + return; > > > > > > For readability change this to if > > (GET_MAJOR_VERSION(old_cluster.major_version) < 1700), because in most > > of the checks related to this, we are using 1700 so better be > > consistent in this. > > > > But the current check is consistent with what we do at other places > during the upgrade. I think the patch is trying to be consistent with > existing code as much as possible. Okay, I see. Thanks for pointing that out. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix issues in binary_upgrade_logical_slot_has_caught_up().
- 0bf62460bb9e 17.0 landed
-
Fix a random failure in 003_logical_slots.pl.
- 63c5df126abb 17.0 landed
-
Fix a test in 003_logical_slots.
- 3e36e48d8efe 17.0 landed
-
Fix uninitialized slot array access during the upgrade.
- a7db71ed2787 17.0 landed
-
Fix the test 003_logical_slots.
- 8af917be6bad 17.0 landed
-
Commit b195e6d482 forgot to update meson.build.
- 8949b978ff49 17.0 landed
-
Use shorter file names in the upgrade logical slots test.
- b195e6d482b8 17.0 landed
-
Migrate logical slots to the new node during an upgrade.
- 29d0a77fa660 17.0 landed
-
Flush logical slots to disk during a shutdown checkpoint if required.
- e0b2eed047df 17.0 landed
-
Prevent possibility of panics during shutdown checkpoint.
- c6c333436491 10.0 cited