<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hello Tatsuo<br />
<br />
This looks great.</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">
<div dir="auto">Thanks!
<div dir="auto"><br /></div>
<div dir="auto">Anirudh</div>
</div>
</div>
</div>
<div name="messageReplySection">On 4 Aug 2021, 8:11 AM +0530, Tatsuo Ishii <ishii@sraoss.co.jp>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">Hi Anirudh,<br />
<br />
I created a patch against master branch to add new parameter<br />
"primary_host" to recovery_1st_stage_command (and<br />
recovery_2ndt_stage_command. This is not necessary in practice but I<br />
want to keep consistency).<br />
<br />
Suppose backend_hostname0 is the current primary node. Then<br />
primary_host is replaced with backend_hostname0.<br />
<br />
Please let me what you think.<br />
<br />
<blockquote type="cite">Hi Anirudh,<br />
<br />
<blockquote type="cite">Hello Tatsuo<br />
<br />
Actually, there might be another way to use environment variables instead of script arguments for all commands.<br />
<br />
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?<br />
<br />
I know this is an additional step to add but it will invoke consistency in how these parameters are passed by pgpool, across scripts.<br /></blockquote>
<br />
<blockquote type="cite">Does this make any sense?<br /></blockquote>
<br />
Well, that can be technically possible but it pollutes PostgreSQL<br />
process with environment variables. Also it is more complicated than<br />
just adding a new parameter to the function. It seems it is not worth<br />
the trouble.<br />
<br />
<blockquote type="cite">Cheers!<br />
<br />
Anirudh<br />
On 15 Jul 2021, 12:24 PM +0530, Tatsuo Ishii <ishii@sraoss.co.jp>, wrote:<br />
<blockquote type="cite">
<blockquote type="cite">Hello Tatsuo<br />
<blockquote type="cite">Unfortunately recovery commands are executed on the PostgreSQL primary<br />
node by calling pgpool_recovery extension. There's no way to pass<br />
environment variables from pgpool side. So my proposal is not applied<br />
to below commands.<br /></blockquote>
<br />
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?<br /></blockquote>
<br />
Yeah, it seems it's the only way.<br />
<br />
Best regards,<br />
--<br />
Tatsuo Ishii<br />
SRA OSS, Inc. Japan<br />
English: http://www.sraoss.co.jp/index_en.php<br />
Japanese:http://www.sraoss.co.jp<br /></blockquote>
</blockquote>
_______________________________________________<br />
pgpool-hackers mailing list<br />
pgpool-hackers@pgpool.net<br />
http://www.pgpool.net/mailman/listinfo/pgpool-hackers<br /></blockquote>
</blockquote>
</div>
</body>
</html>