fix XLogReadBufferExtended read invalid page core, because read block return false ealier when read page failed in standby node.

This commit is contained in:
xiong_xjun
2020-12-12 16:02:41 +08:00
parent 4898995c3a
commit ef159b5540

View File

@ -1058,13 +1058,12 @@ bool mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char* b
}
if (nbytes != BLCKSZ) {
#ifndef ENABLE_MULTIPLE_NODES
if(RecoveryInProgress()) {
return false;
}
#endif
if (nbytes < 0) {
#ifndef ENABLE_MULTIPLE_NODES
if(RecoveryInProgress()) {
return false;
}
#endif
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not read block %u in file \"%s\": %m", blocknum, FilePathName(v->mdfd_vfd))));
@ -1082,6 +1081,11 @@ bool mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char* b
} else {
check_file_stat(FilePathName(v->mdfd_vfd));
force_backtrace_messages = true;
#ifndef ENABLE_MULTIPLE_NODES
if(RecoveryInProgress()) {
return false;
}
#endif
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg("could not read block %u in file \"%s\": read only %d of %d bytes",