Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Date: 2026-07-08 19:20:45
Message-ID: 2ff2a391adc2e86d82803a5f729f42f13448faa1.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2026-07-08 at 10:29 +0530, Amit Kapila wrote:
> Okay, I see your point and we can make it return early when slot_name
> is NONE. However, do we need to consider a case where users want to
> manually manage the subscription's main slot, so it uses
> slot_name=NONE? I mean users want to manually maintain the lifecycle
> of the slot and due to that even during the CREATE SUBSCRIPTION, it
> uses the specified slot_name instead of the default. But still
> tablesync slots need to be removed in such a case as those are
> internally created.

The problem is that we are overloading slot_name=NONE, and as you point
out, it can mean multiple things.

Can we just have DROP SUBSCRIPTION ... FORCE or DROP SUBSCRIPTION ...
NOCONNECT? That allows the user to clearly express their intent at the
time of the drop, rather than guessing from the state of the
subscription.

If it's too late to do that for 19, we should probably just make the
code match the documentation and don't try to connect if
slot_name=NONE. In most ordinary cases that would not cause a problem,
you'd have to have slot_name=NONE and also drop the subscription before
the table syncs finish.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haibo Yan 2026-07-08 19:24:22 [PATCH] ecpg: use memcpy in a few length-based copies
Previous Message Andrey Borodin 2026-07-08 19:17:20 Re: injection_points: Switch wait/wakeup to use atomics rather than latches