mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add GUC to enable WAL-logging of hint bits, even with checksums disabled.
WAL records of hint bit updates is useful to tools that want to examine which pages have been modified. In particular, this is required to make the pg_rewind tool safe (without checksums). This can also be used to test how much extra WAL-logging would occur if you enabled checksums, without actually enabling them (which you can't currently do without re-initdb'ing). Sawada Masahiko, docs by Samrat Revagade. Reviewed by Dilip Kumar, with further changes by me.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user