Re: pgsql: Improve runtime and output of tests for replication slots checkp - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Improve runtime and output of tests for replication slots checkp
Date
Msg-id 2594452.1750462958@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Improve runtime and output of tests for replication slots checkp  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-committers
Alexander Korotkov <aekorotkov@gmail.com> writes:
> And I see the following variable values.

> (lldb) p/x targetPagePtr
> (XLogRecPtr) 0x0000000029004000
> (lldb) p/x RecPtr
> (XLogRecPtr) 0x0000000029002138

> I hardly understand how is this possible given it was compiled with "-O0".
> I'm planning to continue investigating this tomorrow.

Yeah, I see

(lldb) p/x targetPagePtr
(XLogRecPtr) 0x0000000029004000
(lldb) p/x RecPtr
(XLogRecPtr) 0x0000000029002138
(lldb) p/x RecPtr - (RecPtr % 8192)
(XLogRecPtr) 0x0000000029002000

We're here:

            /* Calculate pointer to beginning of next page */
            targetPagePtr += XLOG_BLCKSZ;

            /* Wait for the next page to become available */
            readOff = ReadPageInternal(state, targetPagePtr,
                                       Min(total_len - gotlen + SizeOfXLogShortPHD,
                                           XLOG_BLCKSZ));

so that's where the increment of targetPagePtr came from.
But "Wait for the next page to become available" seems awfully
trusting that there will be another page.  Should this be
using the no-wait code path?

            regards, tom lane



pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Improve runtime and output of tests for replication slots checkp
Next
From: Bruce Momjian
Date:
Subject: pgsql: doc PG 18 relnotes: add remaining missing link tags