Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whKNi-0009gs-2p for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 04:59:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whKNg-004nMV-0d for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 04:59:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whKNf-004nMN-2f for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 04:59:32 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whKNd-00000000Arr-2tm7 for pgsql-hackers@postgresql.org; Wed, 08 Jul 2026 04:59:32 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2caed617615so2721415ad.3 for ; Tue, 07 Jul 2026 21:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783486768; cv=none; d=google.com; s=arc-20260327; b=ESaQ86PAjVGF6kEgyTCYmIXgAKo2N08o9T2vy5WfOQFn+cvV7P1zp6EQbZXtg00QbX /kJW9lOv73TTmeKtO2Cnw+BRh6aOPegBnM6Br5S0Ey5mGwdkexNVsrKlMCBOHSl+y9KU O3c6svoBACAj/TeLROOEAhYz0duHuZK5lNYghqWaP1yC7MeX/MKVu5PX135hqcN2qKa6 OVGbgddSJk3uQR8/OpcJmZvABq59MtHnPOWxEgbaIdcDMUvHCX1sJLillW5rTGQXlzmZ mcFH2wbbeUIpX++mw7+dhSST5YgJKeNRvpRkO1DKqRUnrqsisOL2aCPhHLoAy7t4Mq2t 7HSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=r3pUG/t3cDJdByMtrmOZpXwHWQ4FLId+qyVHsbK5ELw=; fh=RX2x3UdyuKO64rRZ3G9uzgovAbfI33zUnpXzyXfpL1g=; b=cP8q1hbl62wpgY9la4otlaXSKQTy6mWi2Rx8VeRbXYPRASmJuizuJKBxUYQqqRbCIw dpKuOoJHFXNORR4NBKR06TSXYeNnK/UF2cr/rmMml5vxoe0RvrYZkFwHWv2yaHuWKIWn N0luhQuF2kS7YvexKOMUNLCH9LbclWXNuzstifw7iJZHpoWMHbVWOb2cf+1sbv9nWJly N/qMRFvmPAr7IkPbpnIFOgjJWHXBlj93WRfQTLe7MCmitv8LPdW9yF7qI1qK4FDhM6B+ FHf7vVDe4WTeaJexzQNz6GDl8LaEsqYXFsIzEdcncsO3JWE1sueUs6PkugnbOXZrVyml P9hA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783486768; x=1784091568; darn=postgresql.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=r3pUG/t3cDJdByMtrmOZpXwHWQ4FLId+qyVHsbK5ELw=; b=KCugTHKprohOxih/ilvKZOmCHtfbqUt/aSccegKCoiUmJMkpbBbqNg9oevywzZKHCc ulqC8sUXDcEpU2FgubQlOqGHRvlquXdCvnK1ORTYY8ooDXlte9nhYL65vqMQ2+8DpV6d E8kOiG+5F/0OvvJgdLcyj7ySeeNoZR79GBBY9tZmpFQZKpxPJQKeLIgUvi5mUi3aPsKj apX+jE1vJyR3XyW4Nki0wxv0EkgYeV5Ym0WQpP2z46s0I48ofmhZ62AX+peCNGAH4Sdo zEmvmgMXcPAhObsZ3uhH0Lo5t3zY6Uj9EFt8OCj9rcEgd549y8Gs873VjQzpBGMcUvdX bM4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783486768; x=1784091568; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r3pUG/t3cDJdByMtrmOZpXwHWQ4FLId+qyVHsbK5ELw=; b=Q2UXCqcU1ITCjQR9CUR3pXMz6f1Z+prO6wCHpRg6dAY1jHGpl6vysWlI0UBCh67aXk QdJpwRMzm2+kwFE7cH98HbKLdfoIOa3gECI3unLM2xy3qCKWIvPwqh7Fq5Jz3S3T3pBw HK/RzoJCHZAalmuzzbL5LiRoIhGWBRn9K2E50qCt1+mu3gOKDZs8YVW74eZ1gHbqeQPY QNopomyJHQ2nWCYOfHNVDOGjRngum90iQpXexaIRBSAGmd214tj81KKzXLCASINSjWhT CED2ekriUyNZ5Q6mEZQVR+1WruMcwQ67AKFg79USDilYWaN/VmOiJk+Gs+tjQ93pNWr1 6Phw== X-Forwarded-Encrypted: i=1; AHgh+RoR5uI5K9uN64EB+ONMVyf0Egucd/lGDPjrip0fCuZe7IYZmOCYGJ0xOXnmDuDjC4R2QIDvq/Adg+b703bh@postgresql.org X-Gm-Message-State: AOJu0YztBe5ZFG3KZlQkw2eZhVzqqUrkQ5lMMGaglBDjiCf32jQCNJJ4 ZaG/+DgwcQsudIGtvcLRu91B56vwX1cI2r+GWJGwTA4UYqwtfwIcT3R8YUxqTt3VPkKi46GLf9X GgVgUJV+QPBXPMu6+EGBtbhJjiE2Eizk= X-Gm-Gg: AfdE7cm3m3yltX/0M2ehg2YXY2ACFr4rPT6j6DNBa5kWt/d54+7FiWOn3sedb6CHuMN fIp3c2ceyj8h+XG11YyBqBky6C5KcuHAN4DaOYwHRChYjwjCks22b1q3GTJR/8g6JTDwKsUfsOe Ha0vToXgG9KOV/XJfzjfHTYATN2iEeEk99LrViSjza+8ZU6HRQx9cpdqjhKPhpd9mj6L7yWYnEj jiG4C4WPjPlrPxgSg7JuCIs7LF1aKaTCxT0LIrK6mvCwhBKdWtW/qn0lzpGVgMV/vJHWyT0wJZI X6VloKYpM62WyJHX5JlUMUf8KDcYgXm63Shmu66703vYCs1gUPwWtxKDYTnYT85Q+wZm1DXOLi8 = X-Received: by 2002:a17:902:f64d:b0:2ca:b8d:e65e with SMTP id d9443c01a7336-2ccea48bc51mr9195915ad.37.1783486767545; Tue, 07 Jul 2026 21:59:27 -0700 (PDT) MIME-Version: 1.0 References: <960DD2C4-A22C-463A-90ED-86E0FABD8D20@gmail.com> <8B38AFCA-7FFA-44CF-B9A8-81BDCEAFB224@gmail.com> <705148C3-519C-45E7-9EA8-48D9F3B79B06@gmail.com> <1B3A7FF0-3292-484F-992C-27D172772EB8@gmail.com> <65166eb6feb87356f8d60bfe646289ce15a6c729.camel@j-davis.com> <24C6472D-DCAB-4F69-AE8A-FFB4AAB3F6F0@gmail.com> <5c629d2455946ad2fde3c184f64ea2c323ef2133.camel@j-davis.com> <131c80088565c68e64c02572a800316c6bbb379f.camel@j-davis.com> In-Reply-To: <131c80088565c68e64c02572a800316c6bbb379f.camel@j-davis.com> From: Amit Kapila Date: Wed, 8 Jul 2026 10:29:15 +0530 X-Gm-Features: AVVi8CckZLntaoOMAmw-HxVxpwblJYxDmLZM1qwdWJW6cHCjB5wqJegn4sCxKQ4 Message-ID: Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server To: Jeff Davis Cc: "Hayato Kuroda (Fujitsu)" , Chao Li , Zsolt Parragi , Ajin Cherian , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 7, 2026 at 5:11=E2=80=AFAM Jeff Davis wrote= : > > On Mon, 2026-06-29 at 10:07 +0530, Amit Kapila wrote: > > On Wed, Jun 24, 2026 at 7:48=E2=80=AFAM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > I went through the 0003 patch. Apart from HINT message, I found > > > that error code > > > ERRCODE_CONNECTION_FAILURE is always used. Should we report the > > > original errcode > > > of the root cause? > > > > > > > That could be marginally better but not sure if it is worth the > > complexity. I have a few more points regarding 0003: > > * Regarding the point: "we can't absorb every kind of error." In the > > PG_CATCH, re-throw query-cancel / interrupt-class conditions (if > > those > > are possible) instead of swallowing them, otherwise a SIGINT during > > ForeignServerConnectionString() becomes a silent successful DROP (for > > slot_name=3DNONE) or a mislabeled connection error. > > The DROP SUBSCRIPTION documentation says that: > > "To proceed in this situation, first disable the subscription by > executing ALTER SUBSCRIPTION ... DISABLE, and then disassociate it from > the replication slot by executing ALTER SUBSCRIPTION ... SET (slot_name > =3D NONE). After that, DROP SUBSCRIPTION will no longer attempt any > actions on a remote host." > > But that stopped being true after commit ce0fdbfe97. There should be > some kind of escape such that we can force a DROP SUBSCRIPTION to > succeed without trying to connect to the remote host. And if we have > that escape, then we don't need to overcomplicate this by using a > subtransaction and trying to guess which errors are recoverable or not. > 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=3DNONE? 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. Actually, this best-case try to connect to publisher works for such cases. I think this is mostly a theoretical scenario because ideally these tablesync slots should be removed at the end of tablesync especially when users are doing drop subscription as part of planned operation, so we can as well rely on the document as we are doing now. --=20 With Regards, Amit Kapila.