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.94.2) (envelope-from ) id 1sntLZ-006kq3-0p for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 05:23:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sntLX-006pK5-G7 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 05:23:23 +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.94.2) (envelope-from ) id 1sntLX-006pJx-63 for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2024 05:23:23 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sntLT-000Q2I-Rp for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2024 05:23:22 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3e03c736466so1334070b6e.1 for ; Mon, 09 Sep 2024 22:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725945798; x=1726550598; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3PVe+zQZrEbSnD7KxmXCbeBAWWBSlT/PG4mBkCOgr44=; b=Svbt0NaNTdlpEFs9EG+gp4+guUEmvKESeUGTXkxDdvXhs/sPFoQ+Oc3lbSfsnklXBj 6OOJ2LfxWG8oCKk+c78e711Oag51HxynBgjzBiXz7b5dodaJPJV+iZ5OrEuggem41Qo/ W/IMCNmZ+B4/RBQLzV9JjTs137Aff1+QANlptCvYXQDsUrpoS5PTzg6KkpYMb3KDlu8B 2Oy7QIGLCX3AtAS6A2GcBmAsFyPHn3AB5dwycXSFCSbBEsiItHHcNW0Yb0dPPtJwVO71 1asYcRqnzKW1uDPH5oxJIHKvU+CS6mF8LKVY5qG+72oAVsAXodl7EINDXS5OrK3dhWuE NeKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725945798; x=1726550598; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3PVe+zQZrEbSnD7KxmXCbeBAWWBSlT/PG4mBkCOgr44=; b=Hg4VXoXpcBmrtQHbZ9iUMyg0gBmbtrlpucju/IKSpczx3RemtNNtI1QWDIcmYlL2RN 8D7Ezt/qExH0XonlqAHAAkwDIXtjDV9noUaa9FycpwWDfw6dF1GjbbAMcgSg55WMznLc dHrSztAEdRH1yx8UcidMX/745HT0kQQs6wxz3BKCH7IS2ChE0CoWMHhg+TRbN4ko5TZR diSRKqk1zJuAYnynm4mrPJaRk2zh2ZAQlKwpdFPRmR1bTACj8UrhP64RKSubeO8z/Hno cqqHoDV1GcYEBB35mf1iK/tBMiPT5P1T10sP4+pwDwEfUaV6xNM21dCx0toaBznA5H0v 3QmA== X-Forwarded-Encrypted: i=1; AJvYcCUs18jUIAE22Zt2cakEPPoHmKzdzrPKgfayS3m480pKX3zah9XWbVb80hTp+calCoSqerHWQ7o9C+5Xiwxz@lists.postgresql.org X-Gm-Message-State: AOJu0YxzbxkA6Nui6CRzeoTgnJi5ss6IRKK4l+G2UDsHLJkwWR11u3Nx NN6Kv9qgK2BH3uFhCaOd1fw6v5oubrQv9x54e08v4I/c6RQ0KwCnz47QPsQM5XtsMzuStW80XD5 iwrFQW2kjaWbtFNGi5WOsaMuhyv4dQKi/DGQ= X-Google-Smtp-Source: AGHT+IE+edPs6wDaLUu2/n7oAbUv9y1VoU8d2ABmEi8oYi5OcI24hej/TBCzKkJRnNBLuXWNWtdzjINKG28AZFbz0Sk= X-Received: by 2002:a05:6808:152a:b0:3e0:4441:8cc6 with SMTP id 5614622812f47-3e044419044mr3309275b6e.18.1725945798314; Mon, 09 Sep 2024 22:23:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Tue, 10 Sep 2024 10:53:07 +0530 Message-ID: Subject: Re: Disallow altering invalidated replication slots To: Peter Smith Cc: Bharath Rupireddy , PostgreSQL Hackers 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, Sep 10, 2024 at 8:40=E2=80=AFAM Peter Smith = wrote: > > Hi, here are some review comments for patch v1. > > =3D=3D=3D=3D=3D=3D > Commit message > > 1. > ALTER_REPLICATION_SLOT on invalidated replication slots is unnecessary > as there is no way... > > suggestion: > ALTER_REPLICATION_SLOT for invalid replication slots should not be > allowed because there is no way... > > =3D=3D=3D=3D=3D=3D > 2. Missing docs update > > Should this docs page [1] be updated to say ALTER_REPLICATION_SLOT is > not allowed for invalid slots? > > =3D=3D=3D=3D=3D=3D > src/backend/replication/slot.c > > 3. > + if (MyReplicationSlot->data.invalidated !=3D RS_INVAL_NONE) > + ereport(ERROR, > + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), > + errmsg("cannot alter replication slot \"%s\"", name), > + errdetail("This replication slot was invalidated due to \"%s\".", > + SlotInvalidationCauses[MyReplicationSlot->data.invalidated])); > + > > I thought including the reason "invalid" (e.g. "cannot alter invalid > replication slot \"%s\"") in the message might be better, > Agreed, I could see a similar case with a message ("cannot alter invalid database \"%s\"") in the code. Additionally, we should also include Shveta's suggestion to change the detailed message to other similar messages in logical.c --=20 With Regards, Amit Kapila.