On Sat, Dec 21, 2013 at 4:13 AM, Robert Haas <robertmh...@gmail.com> wrote:
> On Fri, Dec 20, 2013 at 9:06 AM, Alvaro Herrera
> <alvhe...@2ndquadrant.com> wrote:
>> Michael Paquier escribió:
>>> On Fri, Dec 20, 2013 at 1:05 PM, Sawada Masahiko <sawada.m...@gmail.com> 
>>> wrote:
>>
>>> > Sorry the patch which I attached has wrong indent on pg_controldata.
>>> > I have modified it and attached the new version patch.
>>> Now that you send this patch, I am just recalling some recent email
>>> from Tom arguing about avoiding to mix lower and upper-case characters
>>> for a GUC parameter name:
>>> http://www.postgresql.org/message-id/30569.1384917...@sss.pgh.pa.us
>>>
>>> To fullfill this requirement, could you replace walLogHints by
>>> wal_log_hints in your patch? Thoughts from others?
>>
>> The issue is with the user-visible variables, not with internal
>> variables implementing them.  I think the patch is sane.  (Other than
>> the fact that it was posted as a patch-on-patch instead of
>> patch-on-master).
>
> But spelling it the same way everywhere really improves greppability.
Yep, finding all the code paths with a single keyword is usually a
good thing. Attached is a purely-aesthetical patch that updates the
internal variable name to wal_log_hints.
-- 
Michael
commit a727578f38ae6574d36fc840ec903cc2a6f4a860
Author: Michael Paquier <mich...@otacoo.com>
Date:   Tue Dec 24 22:56:13 2013 +0900

    Rename internal variable of wal_log_hints for better consistency
    
    Purely-aesthetical patch...

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 1277e71..43a0416 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -79,7 +79,7 @@ bool		XLogArchiveMode = false;
 char	   *XLogArchiveCommand = NULL;
 bool		EnableHotStandby = false;
 bool		fullPageWrites = true;
-bool		walLogHints = false;
+bool		wal_log_hints = false;
 bool		log_checkpoints = false;
 int			sync_method = DEFAULT_SYNC_METHOD;
 int			wal_level = WAL_LEVEL_MINIMAL;
@@ -5271,7 +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_hints = walLogHints;
+	ControlFile->wal_log_hints = wal_log_hints;
 	ControlFile->data_checksum_version = bootstrap_data_checksum_version;
 
 	/* some additional ControlFile fields are set in WriteControlFile() */
@@ -9060,7 +9060,7 @@ static void
 XLogReportParameters(void)
 {
 	if (wal_level != ControlFile->wal_level ||
-		walLogHints != ControlFile->wal_log_hints ||
+		wal_log_hints != ControlFile->wal_log_hints ||
 		MaxConnections != ControlFile->MaxConnections ||
 		max_worker_processes != ControlFile->max_worker_processes ||
 		max_prepared_xacts != ControlFile->max_prepared_xacts ||
@@ -9083,7 +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_hints = walLogHints;
+			xlrec.wal_log_hints = wal_log_hints;
 
 			rdata.buffer = InvalidBuffer;
 			rdata.data = (char *) &xlrec;
@@ -9098,7 +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_hints = walLogHints;
+		ControlFile->wal_log_hints = wal_log_hints;
 		UpdateControlFile();
 	}
 }
@@ -9485,7 +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_hints = walLogHints;
+		ControlFile->wal_log_hints = wal_log_hints;
 
 		/*
 		 * Update minRecoveryPoint to ensure that if recovery is aborted, we
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a605363..f8261b6 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -876,7 +876,7 @@ static struct config_bool ConfigureNamesBool[] =
 			gettext_noop("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modifications"),
 			NULL
 		},
-		&walLogHints,
+		&wal_log_hints,
 		false,
 		NULL, NULL, NULL
 	},
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 954486a..91ba0d1 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -189,7 +189,7 @@ extern bool XLogArchiveMode;
 extern char *XLogArchiveCommand;
 extern bool EnableHotStandby;
 extern bool fullPageWrites;
-extern bool walLogHints;
+extern bool wal_log_hints;
 extern bool log_checkpoints;
 extern int	num_xloginsert_slots;
 
@@ -221,7 +221,7 @@ extern int	wal_level;
  * of the bits make it to disk, but the checksum wouldn't match.  Also WAL-log
  * them if forced by wal_log_hints=on.
  */
-#define XLogHintBitIsNeeded() (DataChecksumsEnabled() || walLogHints)
+#define XLogHintBitIsNeeded() (DataChecksumsEnabled() || wal_log_hints)
 
 /* Do we need to WAL-log information required only for Hot Standby and logical replication? */
 #define XLogStandbyInfoActive() (wal_level >= WAL_LEVEL_HOT_STANDBY)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to