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

Commitb6c4b58

Browse files
committed
Fix a couple of bugs with wal_log_hints.
1. Replay of the WAL record for setting a bit in the visibility mapcontained an assertion that a full-page image of that record type can onlyoccur with checksums enabled. But it can also happen with wal_log_hints, soremove the assertion. Unlike checksums, wal_log_hints can be changed on thefly, so it would be complicated to figure out if it was enabled at the timethat the WAL record was generated.2. wal_log_hints has the same effect on the locking needed to read the LSNof a page as data checksums. BufferGetLSNAtomic() didn't get the memo.Backpatch to 9.4, where wal_log_hints was added.
1 parent8364510 commitb6c4b58

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7413,12 +7413,11 @@ heap_xlog_visible(XLogRecPtr lsn, XLogRecord *record)
74137413
ResolveRecoveryConflictWithSnapshot(xlrec->cutoff_xid,xlrec->node);
74147414

74157415
/*
7416-
* If heap block was backed up, restore it. This can only happen with
7417-
* checksums enabled.
7416+
* If heap block was backed up, restore it.(This can only happen with
7417+
* checksumsor wal_log_hintsenabled).
74187418
*/
74197419
if (record->xl_info&XLR_BKP_BLOCK(1))
74207420
{
7421-
Assert(DataChecksumsEnabled());
74227421
(void)RestoreBackupBlock(lsn,record,1, false, false);
74237422
}
74247423
else
@@ -7441,11 +7440,11 @@ heap_xlog_visible(XLogRecPtr lsn, XLogRecord *record)
74417440

74427441
/*
74437442
* We don't bump the LSN of the heap page when setting the
7444-
* visibility map bit (unless checksumsare enabled, in which case
7445-
* we must), because that would generate an unworkable volume of
7446-
* full-page writes. This exposes us to torn page hazards, but
7447-
* since we're not inspecting the existing page contents in any
7448-
* way, we don't care.
7443+
* visibility map bit (unless checksumsor wal_log_hints is
7444+
*enabled, in which casewe must), because that would generate an
7445+
*unworkable volume offull-page writes. This exposes us to torn
7446+
*page hazards, butsince we're not inspecting the existing page
7447+
*contents in anyway, we don't care.
74497448
*
74507449
* However, all operations that clear the visibility map bit *do*
74517450
* bump the LSN, and those operations will only be replayed if the

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ BufferGetLSNAtomic(Buffer buffer)
21252125
/*
21262126
* If we don't need locking for correctness, fastpath out.
21272127
*/
2128-
if (!DataChecksumsEnabled()||BufferIsLocal(buffer))
2128+
if (!XLogHintBitIsNeeded()||BufferIsLocal(buffer))
21292129
returnPageGetLSN(page);
21302130

21312131
/* Make sure we've got a real buffer, and that we hold a pin on it. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp