diff options
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3277a1cbe68..769f4a202f2 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -12336,12 +12336,12 @@ retry: * validates the page header anyway, and would propagate the failure up to * ReadRecord(), which would retry. However, there's a corner case with * continuation records, if a record is split across two pages such that - * we would need to read the two pages from different sources. For - * example, imagine a scenario where a streaming replica is started up, - * and replay reaches a record that's split across two WAL segments. The - * first page is only available locally, in pg_wal, because it's already - * been recycled in the master. The second page, however, is not present - * in pg_wal, and we should stream it from the master. There is a recycled + * we would need to read the two pages from different sources across two + * WAL segments. + * + * The first page is only available locally, in pg_wal, because it's + * already been recycled on the primary. The second page, however, is not + * present in pg_wal, and we should stream it from the primary. There is a * WAL segment present in pg_wal, with garbage contents, however. We would * read the first page from the local WAL segment, but when reading the * second page, we would read the bogus, recycled, WAL segment. If we @@ -12362,6 +12362,7 @@ retry: * responsible for the validation. */ if (StandbyMode && + (targetPagePtr % wal_segment_size) == 0 && !XLogReaderValidatePageHeader(xlogreader, targetPagePtr, readBuf)) { /* |