Forgot some LSN_FORMAT_ARGS() in xlogreader.c

Started by Michael Paquierover 4 years ago4 messages
#1Michael Paquier
michael@paquier.xyz
1 attachment(s)

Hi all,

As $subject says, I noticed that while scanning the area. Any
objections to make all that more consistent with the style of HEAD?
Please see the attached.
--
Michael

Attachments:

lsn-format-fixes.patchtext/x-diff; charset=us-asciiDownload
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 3ae4127b8a..c0e7c3707d 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -754,8 +754,7 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 					targetRecOff == pageHeaderSize)
 				{
 					report_invalid_record(state, "contrecord is requested by %X/%X",
-										  (uint32) (state->DecodeRecPtr >> 32),
-										  (uint32) state->DecodeRecPtr);
+										  LSN_FORMAT_ARGS(state->DecodeRecPtr));
 					goto err;
 				}
 
@@ -965,13 +964,10 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 					pageHeader = (XLogPageHeader) state->readBuf;
 					if (!(pageHeader->xlp_info & XLP_FIRST_IS_CONTRECORD))
 					{
-						report_invalid_record(
-											  state,
+						report_invalid_record(state,
 											  "there is no contrecord flag at %X/%X reading %X/%X",
-											  (uint32) (state->recordContRecPtr >> 32),
-											  (uint32) state->recordContRecPtr,
-											  (uint32) (state->DecodeRecPtr >> 32),
-											  (uint32) state->DecodeRecPtr);
+											  LSN_FORMAT_ARGS(state->recordContRecPtr),
+											  LSN_FORMAT_ARGS(state->DecodeRecPtr));
 						goto err;
 					}
 
@@ -986,10 +982,8 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 											  state,
 											  "invalid contrecord length %u at %X/%X reading %X/%X, expected %u",
 											  pageHeader->xlp_rem_len,
-											  (uint32) (state->recordContRecPtr >> 32),
-											  (uint32) state->recordContRecPtr,
-											  (uint32) (state->DecodeRecPtr >> 32),
-											  (uint32) state->DecodeRecPtr,
+											  LSN_FORMAT_ARGS(state->recordContRecPtr),
+											  LSN_FORMAT_ARGS(state->DecodeRecPtr),
 											  state->recordRemainLen);
 						goto err;
 					}
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#1)
Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

Michael Paquier <michael@paquier.xyz> writes:

As $subject says, I noticed that while scanning the area. Any
objections to make all that more consistent with the style of HEAD?
Please see the attached.

+1, it's not surprising some places didn't get that memo yet.

regards, tom lane

#3Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Michael Paquier (#1)
Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

At Fri, 23 Apr 2021 13:54:15 +0900, Michael Paquier <michael@paquier.xyz> wrote in

Hi all,

As $subject says, I noticed that while scanning the area. Any
objections to make all that more consistent with the style of HEAD?
Please see the attached.

AFAICS it fixes the all remaining LSN parameters.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

#4Michael Paquier
michael@paquier.xyz
In reply to: Kyotaro Horiguchi (#3)
Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

On Fri, Apr 23, 2021 at 02:18:10PM +0900, Kyotaro Horiguchi wrote:

AFAICS it fixes the all remaining LSN parameters.

Thanks for double-checking. I was not sure if I got all of them or
not. Applied that now as of 4aba61b.
--
Michael