aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/heap/heapam.c2
-rw-r--r--src/backend/access/heap/visibilitymap.c6
-rw-r--r--src/backend/access/transam/xlog.c6
3 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 09174b472b0..91cfae1603d 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -6271,7 +6271,7 @@ log_heap_visible(RelFileNode rnode, Buffer heap_buffer, Buffer vm_buffer,
rdata[1].buffer_std = false;
rdata[1].next = NULL;
- if (DataChecksumsEnabled())
+ if (XLogHintBitIsNeeded())
{
rdata[1].next = &(rdata[2]);
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index 7f40d89b9f1..60ee76a2081 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -287,10 +287,10 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
cutoff_xid);
/*
- * If data checksums are enabled, we need to protect the heap
- * page from being torn.
+ * If data checksums are enabled (or wal_log_hintbits=on), we
+ * need to protect the heap page from being torn.
*/
- if (DataChecksumsEnabled())
+ if (XLogHintBitIsNeeded())
{
Page heapPage = BufferGetPage(heapBuf);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a76aef37f3d..0efb50b17ef 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -79,6 +79,7 @@ bool XLogArchiveMode = false;
char *XLogArchiveCommand = NULL;
bool EnableHotStandby = false;
bool fullPageWrites = true;
+bool walLogHintbits = false;
bool log_checkpoints = false;
int sync_method = DEFAULT_SYNC_METHOD;
int wal_level = WAL_LEVEL_MINIMAL;
@@ -5270,6 +5271,7 @@ BootStrapXLOG(void)
ControlFile->max_prepared_xacts = max_prepared_xacts;
ControlFile->max_locks_per_xact = max_locks_per_xact;
ControlFile->wal_level = wal_level;
+ ControlFile->wal_log_hintbits = walLogHintbits;
ControlFile->data_checksum_version = bootstrap_data_checksum_version;
/* some additional ControlFile fields are set in WriteControlFile() */
@@ -9058,6 +9060,7 @@ static void
XLogReportParameters(void)
{
if (wal_level != ControlFile->wal_level ||
+ walLogHintbits != ControlFile->wal_log_hintbits ||
MaxConnections != ControlFile->MaxConnections ||
max_worker_processes != ControlFile->max_worker_processes ||
max_prepared_xacts != ControlFile->max_prepared_xacts ||
@@ -9080,6 +9083,7 @@ XLogReportParameters(void)
xlrec.max_prepared_xacts = max_prepared_xacts;
xlrec.max_locks_per_xact = max_locks_per_xact;
xlrec.wal_level = wal_level;
+ xlrec.wal_log_hintbits = walLogHintbits;
rdata.buffer = InvalidBuffer;
rdata.data = (char *) &xlrec;
@@ -9094,6 +9098,7 @@ XLogReportParameters(void)
ControlFile->max_prepared_xacts = max_prepared_xacts;
ControlFile->max_locks_per_xact = max_locks_per_xact;
ControlFile->wal_level = wal_level;
+ ControlFile->wal_log_hintbits = walLogHintbits;
UpdateControlFile();
}
}
@@ -9480,6 +9485,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
ControlFile->max_prepared_xacts = xlrec.max_prepared_xacts;
ControlFile->max_locks_per_xact = xlrec.max_locks_per_xact;
ControlFile->wal_level = xlrec.wal_level;
+ ControlFile->wal_log_hintbits = walLogHintbits;
/*
* Update minRecoveryPoint to ensure that if recovery is aborted, we