From b6c4b58ac52aa9046c45bd8c2c9fc8925087c8d3 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 26 Jun 2015 12:38:24 +0300 Subject: Fix a couple of bugs with wal_log_hints. 1. Replay of the WAL record for setting a bit in the visibility map contained an assertion that a full-page image of that record type can only occur with checksums enabled. But it can also happen with wal_log_hints, so remove the assertion. Unlike checksums, wal_log_hints can be changed on the fly, so it would be complicated to figure out if it was enabled at the time that the WAL record was generated. 2. wal_log_hints has the same effect on the locking needed to read the LSN of a page as data checksums. BufferGetLSNAtomic() didn't get the memo. Backpatch to 9.4, where wal_log_hints was added. --- src/backend/storage/buffer/bufmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/storage/buffer/bufmgr.c') diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 19ec7eb231e..18013d59ebf 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -2125,7 +2125,7 @@ BufferGetLSNAtomic(Buffer buffer) /* * If we don't need locking for correctness, fastpath out. */ - if (!DataChecksumsEnabled() || BufferIsLocal(buffer)) + if (!XLogHintBitIsNeeded() || BufferIsLocal(buffer)) return PageGetLSN(page); /* Make sure we've got a real buffer, and that we hold a pin on it. */ -- cgit v1.2.3