Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7dd39e9

Browse files
committed
Fix theoretical torn page hazard.
The original report was concerned with a possible inconsistencybetween the heap and the visibility map, which I was unable toconfirm. The concern has been retracted.However, there did seem to be a torn page hazard when usingchecksums. By not setting the heap page LSN during redo, theprotections of minRecoveryPoint were bypassed. Fixed, along with amisleading comment.It may have been impossible to hit this problem in practice, becauseit would require a page tear between the checksum and the flags, so Iam marking this as a theoretical risk. But, as discussed, it didviolate expectations about the page LSN, so it may have otherconsequences.Backpatch to all supported versions.Reported-by: Konstantin KnizhnikReviewed-by: Konstantin KnizhnikDiscussion:https://postgr.es/m/fed17dac-8cb8-4f5b-d462-1bb4908c029e@garret.ruBackpatch-through: 11
1 parent6a1396f commit7dd39e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7997,8 +7997,7 @@ heap_xlog_visible(XLogReaderState *record)
79977997
/*
79987998
* We don't bump the LSN of the heap page when setting the visibility
79997999
* map bit (unless checksums or wal_hint_bits is enabled, in which
8000-
* case we must), because that would generate an unworkable volume of
8001-
* full-page writes. This exposes us to torn page hazards, but since
8000+
* case we must). This exposes us to torn page hazards, but since
80028001
* we're not inspecting the existing page contents in any way, we
80038002
* don't care.
80048003
*
@@ -8012,6 +8011,9 @@ heap_xlog_visible(XLogReaderState *record)
80128011

80138012
PageSetAllVisible(page);
80148013

8014+
if (XLogHintBitIsNeeded())
8015+
PageSetLSN(page,lsn);
8016+
80158017
MarkBufferDirty(buffer);
80168018
}
80178019
elseif (action==BLK_RESTORED)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp