From 8dd43894b1f5c0148dd36308fc607bfcc909e5bd Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 23 Jan 2023 21:46:30 +0100 Subject: [PATCH] Fix XLogPageRead() comment 7fcbf6a and 2ff6555 changed the function signature of XLogPageRead() but did not update the comment. XLogReaderRoutine contains up to date information about the API, so no need to repeat all that at XLogPageRead(), but fix the mentions of the no longer existing function arguments. --- src/backend/access/transam/xlogrecovery.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index c14d1f3ef63..2a5352f8793 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -3145,10 +3145,12 @@ ReadRecord(XLogPrefetcher *xlogprefetcher, int emode, } /* - * Read the XLOG page containing RecPtr into readBuf (if not read already). - * Returns number of bytes read, if the page is read successfully, or - * XLREAD_FAIL in case of errors. When errors occur, they are ereport'ed, but - * only if they have not been previously reported. + * Read the XLOG page containing targetPagePtr into readBuf (if not read + * already). Returns number of bytes read, if the page is read successfully, + * or XLREAD_FAIL in case of errors. When errors occur, they are ereport'ed, + * but only if they have not been previously reported. + * + * See XLogReaderRoutine.page_read for more details. * * While prefetching, xlogreader->nonblocking may be set. In that case, * returns XLREAD_WOULDBLOCK if we'd otherwise have to wait for more WAL. @@ -3156,11 +3158,11 @@ ReadRecord(XLogPrefetcher *xlogprefetcher, int emode, * This is responsible for restoring files from archive as needed, as well * as for waiting for the requested WAL record to arrive in standby mode. * - * 'emode' specifies the log level used for reporting "file not found" or - * "end of WAL" situations in archive recovery, or in standby mode when - * promotion is triggered. If set to WARNING or below, XLogPageRead() returns - * XLREAD_FAIL in those situations, on higher log levels the ereport() won't - * return. + * xlogreader->private_data->emode specifies the log level used for reporting + * "file not found" or "end of WAL" situations in archive recovery, or in + * standby mode when promotion is triggered. If set to WARNING or below, + * XLogPageRead() returns XLREAD_FAIL in those situations, on higher log + * levels the ereport() won't return. * * In standby mode, if after a successful return of XLogPageRead() the * caller finds the record it's interested in to be broken, it should