[pgpool-general: 7483] Re: Promote specific backend to primary in streaming replication

Nathan Ward lists+pgpool at daork.net
Tue Apr 6 22:18:03 JST 2021


Hello!

> On 7/04/2021, at 12:57 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
> Hi,
> 
>> Thanks for your time on this so far!
>> 
>> Would it be possible to allow these to be changed at runtime without a config change + reload? Perhaps a more generic pcp command, to allow any “reloadable” configuration item to be changed? I’m not sure how many of these there are, and if any of them require deeper changes. Maybe we need a 3rd “class” of configuration item, to allow it to be changed without changing config.
> 
> Not sure. PostgreSQL does not have such a 3rd"class".

That’s true, though you can modify a special configuration file without editing files directly with ALTER SYSTEM and then reload the configuration - i.e. you can make changes to the running server without editing configuration files directly.

Pgpool could somewhat mirror postgres functionality here, if there was an include directive, then a reload is required. If we enabled configuration to be added to such a file with pcp, that would be useful, so it could be done from a remote system perhaps?

Just some thoughts.. these seem like bigger changes, and I’m new here :-)

>> We (and I am sure many others) use config management tools to keep our config in sync. In particular, we use Puppet. I have a module which I’m hoping to be able to publish soon, in fact.
>> 
>> Usually, environments which use config management like this have policies to not modify configuration which is managed.
>> 
>> Switching to a different backend would mean we have to manually update that managed configuration (on the pgpool primary, presumably) and reload, and then run pcp_detach_node against the primary backend. In the time between updating the configuration, and detaching the node, our automation might run and undo our changes which would mean we may get an outcome we don’t expect.
>> An alternative would be to update the configuration in our management system and deploy it - but in many environments making these changes can be quite involved. I don’t think it’s good to require operational changes (i.e. “move the primary function to this backend”) to require configuration updates.
>> 
>> A work-around to this would be to have an include directive in the configuration and include a local, non-managed file for these sorts of temporary changes, but pgpool doesn’t have this at the moment I believe?
> 
> No, pgpool does not have. However I think it would be a good idea to
> have "include" feature like PostgreSQL.

I would certainly use that. My puppet module writes the configuration data twice:
1) In to the main pgpool.conf file.
2) In to one of two files, either a “reloadable” config, or a “restart required” config - so that I can use puppet notifications for changes to those files to trigger either a reload or a restart.
It then does some checks to make sure the pgpool.conf is older than the reloadable/restart required config, etc. etc. - it’s quite messy!

An include directive would make that all a lot easier.. and of course would enable this use case.

--
Nathan Ward




More information about the pgpool-general mailing list