[pgpool-hackers: 3987] Re: Proposal: using environment variables instead of script arguments

Tatsuo Ishii ishii at sraoss.co.jp
Wed Aug 4 11:40:41 JST 2021


Hi Anirudh,

I created a patch against master branch to add new parameter
"primary_host" to recovery_1st_stage_command (and
recovery_2ndt_stage_command. This is not necessary in practice but I
want to keep consistency).

Suppose backend_hostname0 is the current primary node. Then
primary_host is replaced with backend_hostname0.

Please let me what you think.

> Hi Anirudh,
> 
>> Hello Tatsuo
>> 
>> Actually, there might be another way to use environment variables instead of script arguments for all commands.
>> 
>> When the pgpool executes recovery_1st_stage (or recovery_2nd_stage) script on the primary, can it (automatically, in the background) run an additional script before that? Maybe that script can put all these variables in the primary node host「s environment?
>> 
>> I know this is an additional step to add but it will invoke consistency in how these parameters are passed by pgpool, across scripts.
> 
>> Does this make any sense?
> 
> Well, that can be technically possible but it pollutes PostgreSQL
> process with environment variables. Also it is more complicated than
> just adding a new parameter to the function. It seems it is not worth
> the trouble.
> 
>> Cheers!
>> 
>> Anirudh
>> On 15 Jul 2021, 12:24 PM +0530, Tatsuo Ishii <ishii at sraoss.co.jp>, wrote:
>>> > Hello Tatsuo
>>> > > Unfortunately recovery commands are executed on the PostgreSQL primary
>>> > > node by calling pgpool_recovery extension. There's no way to pass
>>> > > environment variables from pgpool side. So my proposal is not applied
>>> > > to below commands.
>>> >
>>> > Fair point. Then as per our other discussion, to pass PRIMARY_NODE_HOST to the recovery_1st_stage script, can we do it by passing it as an argument to the command?
>>>
>>> Yeah, it seems it's the only way.
>>>
>>> Best regards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS, Inc. Japan
>>> English: http://www.sraoss.co.jp/index_en.php
>>> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: online-recovery.diff
Type: application/octet-stream
Size: 9497 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20210804/c90eefcc/attachment.obj>


More information about the pgpool-hackers mailing list