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 1rcnm2-0029zv-Ks for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Feb 2024 14:40:39 +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 1rcnm1-004rJX-6f for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Feb 2024 14:40:37 +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 1rcnm0-004rJP-TR for pgsql-hackers@lists.postgresql.org; Wed, 21 Feb 2024 14:40:37 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rcnly-000BSD-9I for pgsql-hackers@lists.postgresql.org; Wed, 21 Feb 2024 14:40:36 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d23a22233fso39705001fa.2 for ; Wed, 21 Feb 2024 06:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708526433; x=1709131233; 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=kL4NZhlWAxTWRh0w9CdNdXCmAPI9mmhTPy1VfmjPPho=; b=A54f5QaXe2OE6/AcnXDUa23Kx23yYWZyd+kARnJMdOzPZTRfLRLWPk/M1H+klvkfOI afVIsYJn3XESlBCrvI/BM8I+Ys6xiDnfhqjtpVeqXfLkTnCioRK22WPwF02xk5RIcL3p CKezaexA/WfWws6DnEb2FOAW5eKVk/z6b6YmR0eo94RQHgNDYz2TdxWzrEQQlCAJmi86 1Qvkkw14qM+ubNPdmTh0WF0yR7B4z0M8/PWCnTIGnPKlciH/QrOyLb/rShAVhylxD/b8 7eRlzix4E9HBq56u0LKRqsU7LYFU49NWXJ4UCKYEXzfNEbHPhsJu6OdBwXUAxethVOwU bCtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708526433; x=1709131233; 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=kL4NZhlWAxTWRh0w9CdNdXCmAPI9mmhTPy1VfmjPPho=; b=ozuBL0jYbXjqAs0UDJdso8HpiIh2SPgbMisZTmOWzuRVg0sbkHrfZ2cUDsZrlDesGR GLCDJSX+fsVfyFnuiGLvttFerd5VP50KcByAzVNloF7ltB2ogKzkisJ1nzIw950YBhfG uytQTV7SlUefNbjJRacJQVaDLwd6+/XZ+rCwd383r1mPU1l5cB/dCkDIuYsaGJXHn9C1 ZYoj5nNacWSdPsVmYvwMi9KaCPlrH1fMR2ZT3FXqXKfRGstMgSwX/dYsDPooQsZcYU+r 8NXJdiXAfzsFHig0BWtgffMpZ9MOTrSyeq9XrytZQMMUbq8CBT85AuFVP6LJIE8xfLQC YRcQ== X-Gm-Message-State: AOJu0YyTahuGgGjRitb38vhsQAL9vtwiMFtyTzseqyd/ibiGmCVbpOGv 9bbMQ/vI8xnllFi3Db++5QR+R7YacK7yHmqBa8ilo3W7iFf9sli+rSfGAbuY0suc7vpym9x8YNH ttvnYCNMtgbPVoaVU+h43i1ar3izqoA4Pf6k= X-Google-Smtp-Source: AGHT+IELuz4h/vh9XNvNl+M5eW1qszEXOFJtbTtbo3qh3bwLQ40/8T0FkHEv5Iyjf59aiiNNXWBx1Lq/URAOPvbBhlI= X-Received: by 2002:a05:651c:1a1e:b0:2d2:426f:eec4 with SMTP id by30-20020a05651c1a1e00b002d2426feec4mr6070964ljb.51.1708526433300; Wed, 21 Feb 2024 06:40:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Wed, 21 Feb 2024 20:10:00 +0530 Message-ID: Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation To: Bertrand Drouvot Cc: 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 Wed, Feb 21, 2024 at 5:55=E2=80=AFPM Bertrand Drouvot wrote: > > > As far as the 0001 patch is concerned, it reports the > > invalidation_reason as long as slot_contents.data.invalidated !=3D > > RS_INVAL_NONE. I think this is okay. > > > > Thoughts? > > Yeah, looking at the code I agree that looks ok. OTOH, that looks confusi= ng, > maybe we should add a few words about it in the doc? I'll think about it. > Looking at v5-0001: > > + > + invalidation_reason text > + > + > > My initial thought was to put "conflict" value in this new field in case = of > conflict (not to mention the conflict reason in it). With the current pro= posal > invalidation_reason could report the same as conflict_reason, which sound= s weird > to me. > > Does that make sense to you to use "conflict" as value in "invalidation_r= eason" > when the slot has "conflict_reason" not NULL? I'm thinking the other way around - how about we revert https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D00= 7693f2a3ac2ac19affcb03ad43cdb36ccff5b5, that is, put in place "conflict" as a boolean and introduce invalidation_reason the text form. So, for logical slots, whenever the "conflict" column is true, the reason is found in invaldiation_reason column? How does it sound? Again the debate might be "conflict" vs "invalidation", but that looks clean IMHO. --=20 Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com