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 1rlAgP-000XHk-LN for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Mar 2024 16:45: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 1rlAgO-00AYUH-7a for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Mar 2024 16:45:24 +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 1rlAgN-00AYU9-Uf for pgsql-hackers@lists.postgresql.org; Fri, 15 Mar 2024 16:45:24 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rlAgL-004glA-9U for pgsql-hackers@lists.postgresql.org; Fri, 15 Mar 2024 16:45:23 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-56845954ffeso3165194a12.2 for ; Fri, 15 Mar 2024 09:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710521120; x=1711125920; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=OkheQ5ITYqWj56Zul7MrsL8j87Xn2IoT/2HQ+mqgNRA=; b=L0WDwBGj54JB99I04fP1INH1Au7ioOTHzyJDdZ4fqyfZw5P7fkuSrs4AoC1Uh2yb1D W7yTcKcglizHPkQk0aTYi6K7lkVlG7ObNPtF+vu69Hx7dJStGVadaBG7aKcpXBWe0Pie SMS+z/EUJ2VLxU+BW0VhctuUGjR3+jZfo/P/o5Ny64J4njFn3fq+EkTwk2y230bN8UEm GxabZmALAVR/wQ1jgNAtcxFkAgkxkkn3xUU7fbxTLQB8CUo0tBqU/dSxqR6e4DcFVpWI z+zWGC4J0WzG1pk0x5vjsALI8AgUBDtrmwNqBhlBhIU9q5inlvCoHLBDnKHP9HynkIhT 3N4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710521120; x=1711125920; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OkheQ5ITYqWj56Zul7MrsL8j87Xn2IoT/2HQ+mqgNRA=; b=U0MoNRqYTau3mZgaD++Iy/DOQXGEH4/UockXo5G6oAxrJDl9kFLsyUEhUe011bXuMD VuEk4/ebIaO0FAhNhi6/aF2uR5ysHGSiCQ+F5dJLkj2EVxPw4pzipfRCy02ZODyI7BBb OyZw/fXOjAoP9WfH992hv8cvDC9sYt6kS89IuvP1WTEpMzuUP8GucYx1ag2aMn2YnBX6 XarePUObzsJj48WHrYh1wRp7FU1m570Hy3ZporwUT1QRlsK6Mn/YfLgfRsOrPtyiPG7L 9s7rn+pgM3haXVeBtijTJZLT16cjiZ3s9GX76JV4oAIaZDHEHjuTHmBBRDYj1/7rdxMN sSfw== X-Forwarded-Encrypted: i=1; AJvYcCU2Y+tfmChZ18lsUmuSKLVY68m5ySPYkgfT+IK+j/7FR58jUf7qm9xXSpNv6PZBjvkhRixsv/uDJk8J64hxnstLUfqr+8UVLkcMGXZzFrbIk40y X-Gm-Message-State: AOJu0Yy5BK121D0lpxATg+IOUg0sWNzdU8FLlCViYbCl5e1OFf+s1zOV vtXnSdyBtoLkfc/58DxHidHKdLWm3nxBFSDHC0Rzl1A321p9ph3t X-Google-Smtp-Source: AGHT+IFm2ovA7FC0kXQWQThwowOCoP2bDmIBrebd1WqkFH/7IcTSK9VFrFB9vtbXUNdv4U2rd8bYEQ== X-Received: by 2002:a17:906:2bc7:b0:a46:5e1b:58a3 with SMTP id n7-20020a1709062bc700b00a465e1b58a3mr2754044ejg.35.1710521120055; Fri, 15 Mar 2024 09:45:20 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id bq8-20020a170906d0c800b00a46550ec5b1sm1852847ejb.32.2024.03.15.09.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 09:45:19 -0700 (PDT) Date: Fri, 15 Mar 2024 16:45:18 +0000 From: Bertrand Drouvot To: Amit Kapila Cc: Bharath Rupireddy , Nathan Bossart , PostgreSQL Hackers Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation Message-ID: References: <20240301221108.GB3024365@nathanxps13> <20240303214434.GA3036597@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Mar 14, 2024 at 12:24:00PM +0530, Amit Kapila wrote: > On Wed, Mar 13, 2024 at 9:24 PM Bharath Rupireddy > wrote: > > > > On Wed, Mar 13, 2024 at 9:21 AM Amit Kapila wrote: > > > > > > > So, how about we turn conflict_reason to only report the reasons that > > > > actually cause conflict with recovery for logical slots, something > > > > like below, and then have invalidation_cause as a generic column for > > > > all sorts of invalidation reasons for both logical and physical slots? > > > > > > If our above understanding is correct then coflict_reason will be a > > > subset of invalidation_reason. If so, whatever way we arrange this > > > information, there will be some sort of duplicity unless we just have > > > one column 'invalidation_reason' and update the docs to interpret it > > > correctly for conflicts. > > > > Yes, there will be some sort of duplicity if we emit conflict_reason > > as a text field. However, I still think the better way is to turn > > conflict_reason text to conflict boolean and set it to true only on > > rows_removed and wal_level_insufficient invalidations. When conflict > > boolean is true, one (including all the tests that we've added > > recently) can look for invalidation_reason text field for the reason. > > This sounds reasonable to me as opposed to we just mentioning in the > > docs that "if invalidation_reason is rows_removed or > > wal_level_insufficient it's the reason for conflict with recovery". > > > > Fair point. I think we can go either way. Bertrand, Nathan, and > others, do you have an opinion on this matter? Sounds like a good approach to me and one will be able to quickly identify if a conflict occured. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com