From 59bc3f300b8447a407c8f90ebb542d1c0ef0e932 Mon Sep 17 00:00:00 2001
From: Yushi Ogiwara <yushiogiwara@keio.jp>
Date: Fri, 11 Oct 2024 14:45:26 +0900
Subject: [PATCH] fix xid

---
 src/test/modules/xid_wraparound/xid_wraparound.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/test/modules/xid_wraparound/xid_wraparound.c b/src/test/modules/xid_wraparound/xid_wraparound.c
index dce81c0c6d..c5f3b717cf 100644
--- a/src/test/modules/xid_wraparound/xid_wraparound.c
+++ b/src/test/modules/xid_wraparound/xid_wraparound.c
@@ -89,7 +89,11 @@ consume_xids_common(FullTransactionId untilxid, uint64 nxids)
 	 * the cache overflows, but beyond that, we don't keep track of the
 	 * consumed XIDs.
 	 */
-	(void) GetTopTransactionId();
+	if(!FullTransactionIdIsValid(GetTopFullTransactionIdIfAny()))
+	{
+		(void) GetTopTransactionId();
+		consumed++;
+	}
 
 	for (;;)
 	{
-- 
2.40.1

