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 1uaKEe-003pvv-PT for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jul 2025 20:20:44 +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 1uaKEb-0073zc-Rb for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jul 2025 20:20:42 +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 1uaKEb-0073zU-Hj for pgsql-hackers@lists.postgresql.org; Fri, 11 Jul 2025 20:20:42 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uaKEa-006okh-10 for pgsql-hackers@postgresql.org; Fri, 11 Jul 2025 20:20:41 +0000 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3dc9e7d10bdso8107715ab.2 for ; Fri, 11 Jul 2025 13:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752265239; x=1752870039; darn=postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=GSp1NhBmHiJtSBBagws8zS0DtYI+QKuvmFw5rzDwBT4=; b=OHcm4uyMRrcRyhTyePfYahZiixykfwjihdBlTwCl5nhgnbsqo6+if5Tdr/cCJsn7wQ dg5I7gMmWerVuAmgm+SWBE0pQ1NHuJzyzlQ2sWuUg2EDvD5ezI34M0B0ZPFbvimaBj5+ aaJmTMbMWJNWjt/Y+9t2XlZdKkGOXTYI/eqJud85pcDDQUwSZpgTc2/4kaRjZInS8d2O OEO0hAyoFE6gulpf0AgjvdhSTxs5VHyb2V7hCiqhGZXGDkw8QvWNiH7Q1gemqVXC9AoE 4/onYxB4xAMDFmZ75CTv7SjtzUeMR+j62rqTjgg8CybYl0lXJJTza0EQA1W9zYsz9SCf 4acA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752265239; x=1752870039; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GSp1NhBmHiJtSBBagws8zS0DtYI+QKuvmFw5rzDwBT4=; b=s875u6uneX76KzMlT/8IwqOxFUto7M0l+qFO9rpipxsX2oOMR5et3GVPUW+hJ4lvG0 X9qf0xTrcrmp+vMlL/hLwDHcK6IJKjwYi6iOXELubG7i+Lr7dRobNwefQd/Vw8XI1AXk EmOqrufMNLDIjJfQ8Yba8oCihmno99wx1Efm0EpIDbbnLez/cH68vhpHpPTxcpRpzKum 8yDbO2t9y5M+sDvhz7m03FQOtumZP5Fp07aa+ewEykY2M9L8klfM1JtRlV7kZMP+TmMh ZZpglpENNN/lp7mOkkfP1vgyOfIXgpk/ELmBOP/Wp7bvVa4a3RoxfhM1LNHzYzJH3dmE I9LQ== X-Gm-Message-State: AOJu0Yxkdn8+/YCR8aJ+kBVeaW0+OizIT241gIxUr0MB+DWN2gwl09tf NIGboDqAckS7yHVKC7CrUbUnMI4Opafh4yL8A0ZpqGJhOTyjJP+aVDTSISTWvA== X-Gm-Gg: ASbGnctnbZ4NrXj6R94MM2/GQIcJltim74sgfYvG8lPmZqskFKuTXwflk8ue0MDZ3lX 9zZdtKHcB+X8LvAyjjP/xs5gjnLSsHeQhRaSDab56aB6PnNErpueFR6s/bBE8EiBUMGLHs8gjGu QxM7BIMRIhQEov+O2uW/VqvkS2x9uAFq7sSNlFt/WoIJT/ufvkYwksJXqK3gPD9f5oLgnJSFcGW 4RD+bAXDWYfYSyFVSqnJiJ1wD8rZtS7Pyv4psZGX/x++C2Sa/DCMtgjEs3KyQyaNjOAlznh89Pe ksf/LmUieWO50x+BaxUuoj11qKFwtbFw2LaCQtIGeYXjYsYDwph8eCgsKGnkj06l7G7MBujMfIZ WkGrp4W0BR7VeGay4kbpuNEaZ0p69IxUoBDnkL5I4WFy3sGkkfmFy0UCXrcntqD1C8h3zPofFXQ Za4iiQQkxlbyOD X-Google-Smtp-Source: AGHT+IGWuzS83UpJWxNCMAI2byn3n8WtbtvnADo7Q+5eNdGBX4xhAdFeYDQia0fqaLWIcMGcMmjy1A== X-Received: by 2002:a05:6e02:144f:b0:3df:4c0a:a3 with SMTP id e9e14a558f8ab-3e253363d95mr57272435ab.20.1752265239138; Fri, 11 Jul 2025 13:20:39 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-50556b0ec50sm1004954173.119.2025.07.11.13.20.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 13:20:37 -0700 (PDT) Date: Fri, 11 Jul 2025 15:20:35 -0500 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: XLogCtl->ckptFullXid is unused Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qqlduC4Su26xonCd" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qqlduC4Su26xonCd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --qqlduC4Su26xonCd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-Remove-XLogCtl-ckptFullXid.patch From 19a915582492a2a6a02a0c9865aa74fdcb3e66a1 Mon Sep 17 00:00:00 2001 From: Nathan Bossart 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) --qqlduC4Su26xonCd--