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.98.2) (envelope-from ) id 1xDzfp-00000000rBs-3jOm for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2026 07:33:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xDzfo-0000000Fyjh-3gyz for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2026 07:33:16 +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.98.2) (envelope-from ) id 1xDzfo-0000000FyjX-2UBY for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2026 07:33:16 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xDzfl-00000000fjC-4B9J for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2026 07:33:15 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-48afcfc4bf5so2034482f8f.1 for ; Tue, 06 Oct 2026 00:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791271993; x=1791876793; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=wl+Zxu/9S/SLV4jtwj9XJft7k0r3/ZfbkiGztIb08GM=; b=ETKxAWLkPPntjJCIuvVB529x9vEJmI6M0pzHh5aYMbdPktgOYq0ANhy8kwBKgz/abv CJrBDclQfd++JnN629Pktj0bnoMU+bFM/B1W6RJXUXYBM++sQrNHvwo0szlK2nEH4+JE ZkDk/qTCYIh7QXHIDjKbohkTaGcdV9UVcgpjr4yLWcsJdGYc7Vw9vuCSorAin0fG7V0q yab8welKWgu6BHZ3NjSUta2mvJo+ULSeK6+KlrYrG2LE7UOPb3coufknUYf6QZOJaHTC EkPylrTNetOPy+CslzwRbl9vCoXmCP1RQ29Ht5uyu9UdRT7/GvfxyqVy245BP9nayPdN J7Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791271993; x=1791876793; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wl+Zxu/9S/SLV4jtwj9XJft7k0r3/ZfbkiGztIb08GM=; b=jD/H8V5Nu/6aiAJAmJoMSNxMJYzit/UO87J1NOQoH9RH6r2B95lCeTWTYrjillLRWc g4blGWLFqjNhzCbd7UCHeObT4Ec/wo145SohBFOzm8xjMy4Y6CmDom+pkiX6wLQgTCgo P+ePqHDZFYXb9mNwEUIyjpc9/C+9UuRvNrpMSu7+TnMEi0WDTBYgn0YYnS1Z7NLSmAYI gpqszsjVZERBxIawsYFggpnMsQvjFleuqeG7thcXWaSubKHs/XuGwQHaAyYozXMHCNFK 0KybDd8GwZ8XAHY9YtPUv6otNSjaOXKuZexRWFGGhYOVjwDXCy7vxZa05dcbXiilrSXj VQNQ== X-Forwarded-Encrypted: i=1; AKwUvBwNX5Y6NIYX2wPG5IyQRPieStqHR2/eyPUaSbXfjJ9+haAcwul3DxCzDpFixsTx1TM8q7+Qw0MPmNq6g57a@lists.postgresql.org X-Gm-Message-State: AFq9FYI9aQlTRopUSwzIm0UO1v5fSd2ZuJiF6i+9R+C0QIjrWKb7DFg8 meM7m8h0Ta9JZGLX7Mq08LTBX9iTNlddxoYr1+wnJQ2WW+Yy+PcU20Mb X-Gm-Gg: AYBFou0aLo9tDlikd2W17altzaX3FSsYjY1B/uG6GcX2/40LUBkZqmW+F5HCkaLXhjN EKuifJhKMTucIWMH1KIeadwJyUwELMhf8sgYEgIbgGH0sOWYKYMJcWsZ834ctI8GqIY2WN6LJ5f AXUfsHr1XP33Qrsonfq2tGqNZ+9abEPKktS6GyRO4guFOet9LKezlmI8uAyfYePkKuzhhYCxlYa q6g3ERYdmq6oMn49On+fO7TV3UI7w9p88MqV06t4M3YiH+06MvpEc/MX/on9clNjoeirkvztc1v ZAbRjIaPTvM+PPeCDDRfyrPXb6W+hlXdEdkS0AuzB0qfkOYC/zTyxof0um6o4hlf184sptHmjPu n7AePJwLr4Y7cZUcZWKDSO7UpwMtE3nTa76Y4y+epk63tctUC1bP7mGA1myo6Nj4uYdRpR2WAhy ZKb4v1IaljXuFRmORl0FN5BsMTmiRfaR9PlFfUB2KJf3BdGphlgDL6ePVA2/dYXdZIz6TPkJ5Aj IwlaK6MqajcGeuEYiyQe4mXQHj29whhTKcJtjSDDuaNZewkJD7Gz7QhTeDmDFZ9m0Wu X-Received: by 2002:a5d:5d11:0:b0:488:8111:6f4e with SMTP id ffacd0b85a97d-48c6d15fefamr1099215f8f.9.1791271992802; Tue, 06 Oct 2026 00:33:12 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48c62290381sm8515346f8f.25.2026.10.06.00.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 00:33:12 -0700 (PDT) Date: Tue, 6 Oct 2026 07:33:11 +0000 From: Bertrand Drouvot To: shveta malik Cc: Ashutosh Sharma , JoongHyuk Shin , Amit Kapila , Rui Zhao , pgsql-hackers@lists.postgresql.org Subject: Re: Persist slot invalidations before publishing them Message-ID: References: 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 Tue, Oct 06, 2026 at 10:25:35AM +0530, shveta malik wrote: > On Mon, Oct 5, 2026 at 6:54 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Mon, Oct 05, 2026 at 03:22:53PM +0530, Ashutosh Sharma wrote: > > > Thanks. I'll review again once the updated patch is posted. > > > > Thanks! Here it is. > > > > Since we have now modularized this further by introducing > SaveSlotToPathInternal() and SaveInvalidatedSlotToPath(), can we make > SaveSlotToPathInternal() consistent across both flows with respect to > lock acquisition and release? > > We could have SaveSlotToPath() acquire and release the lock, > preferably within a PG_TRY/PG_CATCH block. Additionally, the > 'was_dirty' check can also be moved up into SaveSlotToPath(), since > SaveInvalidatedSlotToPath() always forces a write and doesn't need the > check. > > This way, SaveSlotToPath() would acquire the lock only when the slot > is dirty, and SaveSlotToPathInternal() would not need to handle lock > acquisition/release based on the 'cause' argument. This would also let > us remove the multiple if blocks that currently check the 'cause' and > release the lock. Thoughts? Thanks for the proposal! I looked at it, but I think that it makes ordinary save errors get reported while holding io_in_progress_lock. In particular, the LOG path would perform logging and check for interrupts before releasing the lock. As this is meant to be backpatched, I'm not sure it's worth changing the existing behavior as part of this fix. The proposed cleanup could be considered separately on HEAD as a follow up patch though. What do you think? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com