Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Date
Msg-id ff36d1ab77de76fb844b7005b8dc6a9e2b43c293.camel@j-davis.com
Whole thread
In response to Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
List 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




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: fix pg_mkdir_p to tolerate concurrent directory creation
Next
From: Nathan Bossart
Date:
Subject: Re: enhance wraparound warnings