Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: shveta malik <shveta.malik@gmail.com>
Cc: Ajin Cherian <itsajin@gmail.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-04T02:34:00Z
Lists: pgsql-hackers
Attachments
- v6-0001-Fix-pg_get_publication_tables-race-with-concurren.patch (application/x-patch) patch v6-0001
- v6-0001-PG18-Fix-pg_get_publication_tables-race-with-conc.patch (application/x-patch) patch v6-0001
- v6-0001-PG17-Fix-pg_get_publication_tables-race-with-conc.patch (application/x-patch) patch v6-0001
- v6-0001-PG16-Fix-pg_get_publication_tables-race-with-conc.patch (application/x-patch) patch v6-0001
Hi, On Wed, Apr 29, 2026 at 12:15 AM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > Fixed. Please find the attached v5 patch. > > The fix is needed only for PG16 and later, not PG15 or PG14. The bug > was introduced by b7ae03953690 [1] in PG16, which added a table_open() > call in pg_get_publication_tables(). PG15 and earlier only use > get_rel_namespace() and syscache lookups, both of which gracefully > handle dropped relations (returning InvalidOid/false rather than > erroring). > > I verified the bug and the fix on all affected branches. Please find > the attached version-specific patches for backpatching. Thank you! > > [1] b7ae03953690 - Ignore dropped and generated columns from the column list Please find the attached v6 patch, which fixes a test failure on FreeBSD. This variant of the build forces parallel query via debug_parallel_query=regress, causing the pg_get_publication_tables injection point to fire in parallel workers as well. I disabled forced parallel query for this test case. Thank you! -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com