pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedXLogCtl->ckptFullXid is unused
3+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2025-07-12 8893c3ab36 Remove XLogCtl->ckptFullXid.
* XLogCtl->ckptFullXid is unused
@ 2025-07-11 20:20 Nathan Bossart <nathandbossart@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Bossart @ 2025-07-11 20:20 UTC (permalink / raw)
To: pgsql-hackers
I just noticed $SUBJECT. This seems to be an oversight in commit 2fc7af5,
which simultaneously combined ckptXidEpoch and ckptXid into ckptFullXid and
removed the only use of that information, i.e., GetNextXidAndEpoch(). Any
objections if I remove it now?
--
nathan
Attachments:
v1-0001-Remove-XLogCtl-ckptFullXid.patch (text/plain, 2.5K) download
From 19a915582492a2a6a02a0c9865aa74fdcb3e66a1 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nathan@postgresql.org>
Date: Fri, 11 Jul 2025 15:17:27 -0500
Subject: [PATCH v1 1/1] Remove XLogCtl->ckptFullXid.
---
src/backend/access/transam/xlog.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 88fb9b45b2a..8e7827c6ed9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -449,7 +449,6 @@ typedef struct XLogCtlData
/* Protected by info_lck: */
XLogwrtRqst LogwrtRqst;
XLogRecPtr RedoRecPtr; /* a recent copy of Insert->RedoRecPtr */
- FullTransactionId ckptFullXid; /* nextXid of latest checkpoint */
XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */
@@ -5744,7 +5743,6 @@ StartupXLOG(void)
SetMultiXactIdLimit(checkPoint.oldestMulti, checkPoint.oldestMultiDB, true);
SetCommitTsLimit(checkPoint.oldestCommitTsXid,
checkPoint.newestCommitTsXid);
- XLogCtl->ckptFullXid = checkPoint.nextXid;
/*
* Clear out any old relcache cache files. This is *necessary* if we do
@@ -7437,11 +7435,6 @@ CreateCheckPoint(int flags)
UpdateControlFile();
LWLockRelease(ControlFileLock);
- /* Update shared-memory copy of checkpoint XID/epoch */
- SpinLockAcquire(&XLogCtl->info_lck);
- XLogCtl->ckptFullXid = checkPoint.nextXid;
- SpinLockRelease(&XLogCtl->info_lck);
-
/*
* We are now done with critical updates; no need for system panic if we
* have trouble while fooling with old log segments.
@@ -8516,11 +8509,6 @@ xlog_redo(XLogReaderState *record)
ControlFile->checkPointCopy.nextXid = checkPoint.nextXid;
LWLockRelease(ControlFileLock);
- /* Update shared-memory copy of checkpoint XID/epoch */
- SpinLockAcquire(&XLogCtl->info_lck);
- XLogCtl->ckptFullXid = checkPoint.nextXid;
- SpinLockRelease(&XLogCtl->info_lck);
-
/*
* We should've already switched to the new TLI before replaying this
* record.
@@ -8577,11 +8565,6 @@ xlog_redo(XLogReaderState *record)
ControlFile->checkPointCopy.nextXid = checkPoint.nextXid;
LWLockRelease(ControlFileLock);
- /* Update shared-memory copy of checkpoint XID/epoch */
- SpinLockAcquire(&XLogCtl->info_lck);
- XLogCtl->ckptFullXid = checkPoint.nextXid;
- SpinLockRelease(&XLogCtl->info_lck);
-
/* TLI should not change in an on-line checkpoint */
(void) GetCurrentReplayRecPtr(&replayTLI);
if (checkPoint.ThisTimeLineID != replayTLI)
--
2.39.5 (Apple Git-154)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: XLogCtl->ckptFullXid is unused
@ 2025-07-11 21:32 Aleksander Alekseev <aleksander@tigerdata.com>
parent: Nathan Bossart <nathandbossart@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Aleksander Alekseev @ 2025-07-11 21:32 UTC (permalink / raw)
To: pgsql-hackers; +Cc: Nathan Bossart <nathandbossart@gmail.com>
Hi Nathan,
> I just noticed $SUBJECT. This seems to be an oversight in commit 2fc7af5,
> which simultaneously combined ckptXidEpoch and ckptXid into ckptFullXid
and
> removed the only use of that information, i.e., GetNextXidAndEpoch(). Any
> objections if I remove it now?
Good catch. I don't see any reason why we might want to keep ckptFullXid.
Also I checked if there are any references left to this field - there are
none.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: XLogCtl->ckptFullXid is unused
@ 2025-07-12 19:36 Nathan Bossart <nathandbossart@gmail.com>
parent: Aleksander Alekseev <aleksander@tigerdata.com>
0 siblings, 0 replies; 3+ messages in thread
From: Nathan Bossart @ 2025-07-12 19:36 UTC (permalink / raw)
To: Aleksander Alekseev <aleksander@tigerdata.com>; +Cc: pgsql-hackers
On Sat, Jul 12, 2025 at 12:32:31AM +0300, Aleksander Alekseev wrote:
> Good catch. I don't see any reason why we might want to keep ckptFullXid.
> Also I checked if there are any references left to this field - there are
> none.
Thanks, committed.
--
nathan
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-07-12 19:36 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-11 20:20 XLogCtl->ckptFullXid is unused Nathan Bossart <nathandbossart@gmail.com>
2025-07-11 21:32 ` Aleksander Alekseev <aleksander@tigerdata.com>
2025-07-12 19:36 ` Nathan Bossart <nathandbossart@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox