From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Elvis Pranskevichus <elprans(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable. |
Date: | 2017-03-23 08:50:20 |
Message-ID: | CABUevExopW8jxMdj2j2UnP-FZVU-0zESo8kPAGZYp8X=HMc1Ug@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Mar 22, 2017 at 9:00 PM, Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
> On 3/22/17 14:09, Robert Haas wrote:
> >> The opposite means primary. I can flip the GUC name to "is_primary", if
> >> that's clearer.
> > Hmm, I don't find that clearer. "hot standby" has a very specific
> > meaning; "primary" isn't vague, but I would say it's less specific.
>
> The problem I have is that there is already a GUC named "hot_standby",
> which determines whether an instance is in hot (as opposed to warm?)
> mode if it is a standby. This is proposing to add a setting named
> "in_hot_standby" which says nothing about the hotness, but something
> about the standbyness. Note that these are all in the same namespace.
>
> I think we could use "in_recovery", which would be consistent with
> existing naming.
>
One thing we might want to consider around this -- in 10 we have
target_session_attrs=read-write (since
721f7bd3cbccaf8c07cad2707826b83f84694832), which will issue a SHOW
transaction_read_only on the connection.
We should probably consider if there is some way we can implement these two
things the same way. If we're inventing a new variable that gets pushed on
each connection, perhaps we can use that one and avoid the SHOW command? Is
the read-write thing really interesting in the aspect of the general case,
or is it more about detectinv readonly standbys as well? Or to flip that,
would sending the transaction_read_only parameter be enough for the usecase
in this thread, without having to invent a new variable?
(I haven't thought it through all the way, but figured I should mention the
thought as I'm working through my email backlog.)
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Rijkers | 2017-03-23 09:13:53 | Re: bug/oversight in TestLib.pm and PostgresNode.pm |
Previous Message | Simon Riggs | 2017-03-23 08:25:57 | Re: Measuring replay lag |