RE: [PoC] pg_upgrade: allow to upgrade publisher node
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Amit Kapila' <amit.kapila16@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.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-20T05:30:11Z
Lists: pgsql-hackers
Attachments
- v41-0001-pg_upgrade-Allow-to-replicate-logical-replicatio.patch (application/octet-stream) patch v41-0001
Dear Amit, Thank you for reviewing! PSA new version. In this version I ran pgindent again. > +#include "access/xlogdefs.h" > #include "common/relpath.h" > #include "libpq-fe.h" > > The above include is not required. I have removed that and made a few > cosmetic changes in the attached. Yes, it is not needed anymore. Firstly it was introduced to use the datatype XLogRecPtr, but removed in recent version. Moreover, I my colleague Hou found several problems for v40. Here is a fixed version. Below bullets are the found issues. * Fixed to allow XLOG_SWICH when reading the record, including the initial one. The XLOG_SWICH may inserted after walsender exits. This is occurred when archive_mode is set to on (or always). * Fixed to set max_slot_wal_keep_size -1 only when the cluster is PG17+. max_slot_wal_keep_size was introduced in PG13, so previous patch could not upgrade from PG12 and prior. The setting is only needed to upgrade logical slots, so it should be set only when in PG17 and later. * Avoid to call binary_upgrade_validate_wal_records() when the slot is invalidated. The function raises an ERROR if the record corresponds to the given LSN. The output is like: ``` ERROR: requested WAL segment pg_wal/000000010000000000000001 has already been removed ``` It is usual behavior but we do not want to error out here, so it was avoided. The upgrading would fail correctly if there are invalid slots. Best Regards, Hayato Kuroda FUJITSU LIMITED
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