Re: [DOCS] max_worker_processes on the standby - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [DOCS] max_worker_processes on the standby
Date
Msg-id 20151203223014.GU2763@alvherre.pgsql
Whole thread Raw
In response to Re: [DOCS] max_worker_processes on the standby  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
Petr Jelinek wrote:

> While this seems good, I'd code it slightly differently. I didn't like the
> addition of new bool when it's not really needed. This brings the question
> if we actually need the BootStrapCommitTs and StartupCommitTs functions
> which really don't do much though.

Thanks, it's certainly nice that this got simpler.  (I'm not in love
with the idea of having xlog.c know what flag needs to pass in each
case, but I don't see any option that's more convenient.)

We weren't quite there however -- namely this patch didn't close problem
#8 in Fujii-san rundown.  The problem is that when promoting,
standbyState is not STANDBY_DISABLED but STANDBY_SNAPSHOT_READY (which
is a bit surprising but not something this patch should fix).  To fix
this I took the StartupCommitTs() call out of that block, so that it
runs inconditionally.

I also changed the hint message:

postgres=# select * from pg_last_committed_xact();
ERROR:  could not get commit timestamp data
HINT:  Make sure the configuration parameter "track_commit_timestamp" is set in the master server.

Otherwise this would be very confusing:

postgres=# select * from pg_last_committed_xact();
ERROR:  could not get commit timestamp data
HINT:  Make sure the configuration parameter "track_commit_timestamp" is set.
postgres=# show track_commit_timestamp ;
 track_commit_timestamp
------------------------
 on
(1 fila)

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: atomic reads & writes (with no barriers)
Next
From: Robert Haas
Date:
Subject: Re: eXtensible Transaction Manager API