Re: [PoC] pg_upgrade: allow to upgrade publisher node
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: John Naylor <johncnaylorls@gmail.com>, vignesh C <vignesh21@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>,
Peter Smith <smithpb2250@gmail.com>, Andres Freund <andres@anarazel.de>, Dilip Kumar <dilipbalaut@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Bruce Momjian <bruce@momjian.us>, Julien Rouhaud <rjuju123@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2023-11-30T03:10:28Z
Lists: pgsql-hackers
On Wed, Nov 29, 2023 at 2:56 PM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > > > > > > > > Pushed! > > > > > > Hi all, the CF entry for this is marked RfC, and CI is trying to apply > > > the last patch committed. Is there further work that needs to be > > > re-attached and/or rebased? > > > > > > > No. I have marked it as committed. > > > > I found another failure related with the commit [1]. I think it is caused by the > autovacuum. I want to propose a patch which disables the feature for old publisher. > > More detail, please see below. > > # Analysis of the failure > > Summary: this failure occurs when the autovacuum starts after the subscription > is disabled but before doing pg_upgrade. > > According to the regress file, it unexpectedly failed the pg_upgrade [2]. There are > no possibilities for slots are invalidated, so some WALs seemed to be generated > after disabling the subscriber. > > Also, server log caused by oldpub said that autovacuum worker was terminated when > it stopped. This was occurred after walsender released the logical slots. WAL records > caused by autovacuum workers could not be consumed by the slots, so that upgrading > function returned false. > > # How to reproduce > > I made a small file for reproducing the failure. Please see reproduce.txt. This contains > changes for launching autovacuum worker very often and for ensuring actual works are > done. After applying it, I could reproduce the same failure every time. > > # How to fix > > I think it is sufficient to fix only the test code. > The easiest way is to disable the autovacuum on old publisher. PSA the patch file. > Agreed, for now, we should change the test as you proposed. I'll take care of that. However, I wonder, if we should also ensure that autovacuum or any other worker is shut down before walsender processes the last set of WAL before shutdown. We can analyze more on this and probably start a separate thread to discuss this point. -- With Regards, Amit Kapila.
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