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 1vH5y0-00Dfsa-At for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Nov 2025 19:48:20 +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 1vH5xz-009zlh-1k for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Nov 2025 19:48:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vH5xy-009zlY-5a for pgsql-hackers@lists.postgresql.org; Thu, 06 Nov 2025 19:48:18 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vH5xw-005m6r-0h for pgsql-hackers@lists.postgresql.org; Thu, 06 Nov 2025 19:48:17 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 274421400197; Thu, 6 Nov 2025 14:48:15 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 06 Nov 2025 14:48:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1762458495; x= 1762544895; bh=yXGRu/7+1ddSiX3M1FG8D7s879WOSfXQjP0tBIL3FCc=; b=d hWiZNbobXy+LT0TV/MtckJy74FhS1aZu7VEMtHWaqBhk7zlpcJKsW/EwtStykTxT Tj46j4SbDCCmPWCeh47kFTFIPGzGk0CBqh+YdtG8DDDng/qwFetfuddimBzeu0Gy 0u3pCkJGH92GICmI6oqPhICmPgslN53oFlkzVt23FvIuRka7pbfLZkXPYFoeJHz0 BjCB3SWrWiW5VB7e+fxtxoUdv1ZCfVsa/Vf796kSgBqqqr73MrHnd0mXXGioucpa NmY2L2v9FXSM7BpkeESksxZ1YrgUOZqkjmgPUu4hckDTirdr0ijVzHy2w1DHmkoa dl1TpQpmtz6i4d8rVolyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762458495; x=1762544895; bh=y XGRu/7+1ddSiX3M1FG8D7s879WOSfXQjP0tBIL3FCc=; b=P+MUQ4qwDV9axL79z dTvAHqnJH5Rh3NTP3AhiWjUvCbHVHNZDArTaY3FuCOiKoLILRGbFqi4cLIMU9SiD X8A1xR0CQCa5Uy1R/Cf6Ej65Aim3SkIGvqeeK73EzBhvw55nvRhc7JwE0kNtQo9l 0SwX5BLVBIRG82r5rhEaJ1Ff0ZZ2W6/+Ytf0wzVCLRmM3QRqqDtGv645STsKjDCY BsKQQKYA41J91WiRQTtlKSNEVX3W7GWJOVJ7jwhNTtI4C4kT6rMJkSDkiGEH/O0a 31GPqn5btFwXma9vyStYvvGRltOP7O88iy/np0Cimt7F3T4VN5231wiaMuw5YQhs zjLXg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeejieeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdprhgtphht thhopegsvghrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtph htthhopehhlhhinhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgr tghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmh hitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopehquhgrnhiiohhnghhl ihgrnhhgseihvggrhhdrnhgvth X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Nov 2025 14:48:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1762458491; bh=z616MyGF2bcLxZtyll0qU1Az6Uwbj7eowyPfZBym148=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=J4G+qlbvI4CfvriJTGqEsO7/HOEpJaQGNGqHYVzvbaf2aI7E7yv1aPGF3P0fE+FTk U9XabIWCGawuFqjtKEwCAmsEAB3P+CG5webDWJPVLJVyMNCPbePVVC4n2wTWByR1hJ QEDqDV+DNg/wspjBKlfWcO6p/uEyoxpICxhSO9JNep/yVPzCY2uFc7EKPXJ2Qa23T3 TVOeV7wbywFtEccQNFJgS30wtV5Kz1KEKtgXWaIsDIP7bHSE1ra6XRJhVhqKAv428g wkGadrQXo0M3cmd7lOBxzP8U96h6NWvLPgHDDeAr4zgq5cHXoXwkvWN1zMoyMe9Zc4 kkXoR21is1NTQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 7775976; Thu, 06 Nov 2025 21:48:11 +0200 (EET) Date: Thu, 6 Nov 2025 20:48:11 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Bertrand Drouvot Cc: Peter Eisentraut , Michael Paquier , Heikki Linnakangas , Quan Zongliang , pgsql-hackers@lists.postgresql.org Subject: Re: Consistently use the XLogRecPtrIsInvalid() macro Message-ID: <202511061936.ivzq6rvsny27@alvherre.pgsql> 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 On 2025-Nov-06, Bertrand Drouvot wrote: > I see, I would have introduced XLogRecPtrIsInvalid() on the back branches only > if there is a need to (a bugfix that would make use of it). But yeah, I agree > that would add extra "unnecessary" work, so done as you suggested in the > attached. I checked that 0001 apply on the [14-18]_STABLE branches successfully. Okay, thanks, I have applied that one to all stable branches, except I didn't add the judgemental comment about XLogRecPtrIsInvalid(). I also pushed 0002+0004+0005 together as one commit, so now we have XLogRecPtrIsValid() everywhere. I did a couple of minor transformations, where the new code would end doing "!XLogRecPtrIsValid(x) ? A : B" it seems clearer to remove the negation and invert the other two arguments in the ternary. We also had this assertion, - Assert(XLogRecPtrIsInvalid(state->istartpoint) == (state->istarttli == 0)); which was being transformed to have a negation. I chose to negate the other side of the equality instead, that is, + Assert(XLogRecPtrIsValid(state->istartpoint) == (state->istarttli != 0)); which also seems clearer. Now only 0003 remains ... I would change the complaining version to 21 there, because why not? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ Maybe there's lots of data loss but the records of data loss are also lost. (Lincoln Yeoh)