Skip to content

Commit 4637a6a

Browse files
committed
Silence "missing contrecord" error.
Commit dd38ff2 added a new error message "missing contrecord" when we fail to reassemble a record. Unfortunately that caused noisy messages to be logged by pg_waldump at end of segment, and by walsender when asked to shut down on a segment boundary. Remove the new error message, so that this condition signals end-of- WAL without a message. It's arguably a reportable condition that should not be silenced while performing crash recovery, but fixing that without introducing noise in the other cases will require more research. Back-patch to 15. Reported-by: Tomas Vondra <tomas.vondra@enterprisedb.com> Discussion: https://postgr.es/m/6a1df56e-4656-b3ce-4b7a-a9cb41df8189%40enterprisedb.com
1 parent ce5aaea commit 4637a6a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/backend/access/transam/xlogreader.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -914,15 +914,11 @@ XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking)
914914
state->missingContrecPtr = targetPagePtr;
915915

916916
/*
917-
* If we got here without reporting an error, report one now so that
918-
* XLogPrefetcherReadRecord() doesn't bring us back a second time and
919-
* clobber the above state. Otherwise, the existing error takes
920-
* precedence.
917+
* If we got here without reporting an error, make sure an error is
918+
* queued so that XLogPrefetcherReadRecord() doesn't bring us back a
919+
* second time and clobber the above state.
921920
*/
922-
if (!state->errormsg_buf[0])
923-
report_invalid_record(state,
924-
"missing contrecord at %X/%X",
925-
LSN_FORMAT_ARGS(RecPtr));
921+
state->errormsg_deferred = true;
926922
}
927923

928924
if (decoded && decoded->oversized)

0 commit comments

Comments
 (0)