Re: pg_upgrade and logical replication
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, pgsql-hackers@lists.postgresql.org, Vitaliy Kukharik <vitaliy@postgres.ai>
Date: 2023-03-01T00:43:10Z
Lists: pgsql-hackers
On Tue, Feb 28, 2023 at 08:02:13AM -0800, Nikolay Samokhvalov wrote: > On Fri, Feb 17, 2023 at 7:35 AM Julien Rouhaud <rjuju123@gmail.com> wrote: > > > > Any table later added in the > > publication is either already fully replicated until that LSN on the upgraded > > node, so only the delta is needed, or has been created after that LSN. In the > > latter case, the entirety of the table will be replicated with the logical > > replication as a delta right? > > What if we consider a slightly adjusted procedure? > > 0. Temporarily, forbid running any DDL on the source cluster. This is (at least for me) a non starter, as I want an approach that doesn't impact the primary node, at least not too much. Also, how would you do that? If you need some new infrastructure it means that you can only upgrade nodes starting from pg16+, while my approach can upgrade any node that supports publications as long as the target version is pg16+. It also raises some concerns: why prevent any DDL while e.g. creating a temporary table shouldn't not be a problem, same for renaming some underlying object, adding indexes... You would have to curate a list of what exactly is allowed which is never great. Also, how exactly would you ensure that indeed DDL were forbidden since a long enough point in time rather than just "currently" forbidden at the time you do some check?
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