Re: Turning recovery.conf into GUCs

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>, Alex Shulgin <ash(at)commandprompt(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Jaime Casanova <jaime(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Turning recovery.conf into GUCs
Date: 2015-01-06 05:57:57
Message-ID: 54AB7965.5090700@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/05/2015 05:43 PM, Peter Eisentraut wrote:
> The wins on the other hand are obscure: You can now use SHOW to inspect
> recovery settings. You can design your own configuration file include
> structures to set them. These are not bad, but is that all?

That's not the only potential win, and it's not small either. I'll be
able to tell what master a replica is replicating from using via a port
5432 connection (currently there is absolutely no way to do this).

> I note that all the new settings are PGC_POSTMASTER, so you can't set
> them on the fly. Changing primary_conninfo without a restart would be a
> big win, for example. Is that planned?

... but there you have the flaw in the ointment. Unless we make some of
the settings superuserset, no, it doesn't win us a lot, except ...

> I have previously argued for a different approach: Ready recovery.conf
> as a configuration file after postgresql.conf, but keep it as a file to
> start recovery. That doesn't break any old workflows, it gets you all
> the advantages of having recovery parameters in the GUC system, and it
> keeps all the options open for improving things further in the future.

... and there you hit on one of the other issues with recovery.conf,
which is that it's a configuration file with configuration parameters
which gets automatically renamed when a standby is promoted. This plays
merry hell with configuration management systems. The amount of
conditional logic I've had to write for Salt to handle recovery.conf
truly doesn't bear thinking about. There may be some other way to make
recovery.conf configuration-management friendly, but I haven't thought
of it.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-01-06 06:20:20 Re: segmentation fault in execTuples.c#ExecStoreVirtualTuple
Previous Message Michael Paquier 2015-01-06 05:54:19 Re: Patch: add recovery_timeout option to control timeout of restore_command nonzero status code