aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2015-12-03 19:22:31 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2015-12-03 19:22:31 -0300
commit820ddb2c2f162ef1b086d870e9da0702834b6f32 (patch)
treebe8d289d0ad7bf85516f9dab1d529750332f02f5 /src/backend/access/transam/xlog.c
parent344cdff2c1541e7a1249299a33723aabeafa0b0c (diff)
downloadpostgresql-820ddb2c2f162ef1b086d870e9da0702834b6f32.tar.gz
postgresql-820ddb2c2f162ef1b086d870e9da0702834b6f32.zip
Further tweak commit_timestamp behavior
As pointed out by Fujii Masao, we weren't quite there on a standby behaving sanely: first because we were failing to acquire the correct state in the case where no XLOG_PARAMETER_CHANGE message was sent (because a checkpoint had already happened after the setting was changed in the master, and then the standby was restarted); and second because promoting the standby with the feature enabled failed to activate it if the master had the feature disabled. This patch fixes both those misbehaviors hopefully without re-introducing any old problems. Also change the hint emitted in a standby together with the error message about the feature being disabled, to make it point out that the place to chance the setting is the master. Otherwise, if the setting is already enabled in the standby, it is very confusing to have it say that the setting must be enabled ... Authors: Álvaro Herrera, Petr Jelínek. Backpatch to 9.5.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f17f83417d1..86debf44123 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6568,6 +6568,10 @@ StartupXLOG(void)
* Startup commit log, commit timestamp and subtrans only.
* MultiXact has already been started up and other SLRUs are not
* maintained during recovery and need not be started yet.
+ *
+ * For commit timestamps, we do this based on the control file
+ * info: in a standby, we want to drive it off the state of the
+ * master, not local configuration.
*/
StartupCLOG();
StartupCommitTs(ControlFile->track_commit_timestamp);
@@ -7339,7 +7343,7 @@ StartupXLOG(void)
if (standbyState == STANDBY_DISABLED)
{
StartupCLOG();
- StartupCommitTs(false);
+ StartupCommitTs(track_commit_timestamp);
StartupSUBTRANS(oldestActiveXID);
}