Alexander Korotkov <aekorot...@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