Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Amit Kapila <amit.kapila16@gmail.com>, Chao Li <li.evan.chao@gmail.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Ajin Cherian <itsajin@gmail.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-06-19T18:40:34Z
Lists: pgsql-hackers
On Wed, 2026-06-17 at 16:10 -0700, Jeff Davis wrote: > v7-0003 is more than just an error message change, so I updated the > commit message. It handles the case where the drop path has > rstates!=NIL but slot_name=NONE: without 0003, the drop will fail > while > trying to construct the conninfo (without the HINT); with 0003, the > drop will silently succeed without removing the tablesync slots (as > it > does with a connection failure when subconninfo is set). > > If the use of a subtransaction is fine there, then I think we should > proceed with 0003 and whatever hint message is agreeable. 0002 committed. For 0003, I don't think we can absorb every kind of error that might happen inside fdwconnection. libpqrcv_connect() doesn't attempt to do so, so neither should construct_subserver_conninfo(). What 0003 is really trying to avoid is fairly normal kinds of errors that can happen on a non-broken FDW that get in the way of dropping a subscription. That includes a missing user mapping or a failed ACL check. But aside from that, it's hard to think of other examples we'd clearly want to absorb. Options: * check for those two error codes explicitly * try to be more systematic about what kinds of errors should be absorbed or not * add an escape hatch for users to turn off tablesync slots so that DROP will always succeed * consider it an unimportant edge case and leave it the way it is (with 0001 & 0002 already done), and close the open item Thoughts? Regards, Jeff Davis
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid errors during DROP SUBSCRIPTION when slot_name is NONE.
- 702e9dfd6c50 19 (unreleased) landed
-
Avoid errors during ALTER SUBSCRIPTION.
- e5c40584a712 19 (unreleased) landed
-
Check retain_dead_tuples for ALTER SUBSCRIPTION ... SERVER.
- 8eba2edb8010 19 (unreleased) landed
-
Allow multiple xacts during table sync in logical replication.
- ce0fdbfe9722 14.0 cited