Re: pg_upgrade: optimize replication slot caught-up check
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>, Chao Li <li.evan.chao@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-27T20:04:46Z
Lists: pgsql-hackers
Attachments
- v8-0001-pg_upgrade-Optimize-replication-slot-caught-up-ch.patch (application/octet-stream) patch v8-0001
On Tue, Jan 27, 2026 at 3:59 AM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Fri, Jan 23, 2026 at 2:04 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > I haven't reviewed v7 in detail but while glancing, I noticed a few > minor comments: > > 1. > + * Returns the last LSN decodable WAL record's LSN if found, otherwise > + * returns InvalidXLogRecPtr. > */ > -bool > -LogicalReplicationSlotHasPendingWal(XLogRecPtr end_of_wal) > +XLogRecPtr > +LogicalReplicationSlotHasPendingWal(XLogRecPtr end_of_wal, > + XLogRecPtr scan_cutoff_lsn) > > The function name suggests that it will return boolean (due to 'Has' > in its name) but after this change that is not true. > > 2. > We > + * also use the maximum confirmed_flush_lsn as an early scan > + * cutoff; finding a decodable WAL record beyond this point > + * implies that no slot has caught up. > + * > > In this comment, it is not clear if the maximum confirmed_flush_lsn is > among all logical slots (of current database) or what? > Thank you for the comments! I've incorporated these comments I got so far. Amit, are you planning to review the patch in detail? If so, I want to incorporate comments before the push. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com
Commits
-
pg_upgrade: Optimize logical replication slot caught-up check.
- 7a1f0f8747a7 19 (unreleased) landed
-
pg_upgrade: Parallelize retrieving relation information.
- 6d3d2e8e541f 18.0 cited
-
Migrate logical slots to the new node during an upgrade.
- 29d0a77fa660 17.0 cited