From 16e7a6e300ece55efaf67bf22e9d5f5d488e5114 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Tue, 28 Oct 2025 05:39:59 +0000
Subject: [PATCH v1 01/20] make use of XLogRecPtrIsInvalid in rewriteheap.c

---
 src/backend/access/heap/rewriteheap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 100.0% src/backend/access/heap/

diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 8061e92f044..e4cff133886 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -1169,7 +1169,7 @@ CheckPointLogicalRewriteHeap(void)
 	cutoff = ReplicationSlotsComputeLogicalRestartLSN();
 
 	/* don't start earlier than the restart lsn */
-	if (cutoff != InvalidXLogRecPtr && redo < cutoff)
+	if (!XLogRecPtrIsInvalid(cutoff) && redo < cutoff)
 		cutoff = redo;
 
 	mappings_dir = AllocateDir(PG_LOGICAL_MAPPINGS_DIR);
@@ -1204,7 +1204,7 @@ CheckPointLogicalRewriteHeap(void)
 
 		lsn = ((uint64) hi) << 32 | lo;
 
-		if (lsn < cutoff || cutoff == InvalidXLogRecPtr)
+		if (lsn < cutoff || XLogRecPtrIsInvalid(cutoff))
 		{
 			elog(DEBUG1, "removing logical rewrite file \"%s\"", path);
 			if (unlink(path) < 0)
-- 
2.34.1

