<div dir="ltr">Hi Ishii-San<div><br></div><div>Thanks for looking into the patch and valuable feedback.</div><div><br></div><div>Please find the V2 of the patch that fixes the mentioned issues</div><div>except the extended-query-test produces, that is failing because the expected</div><div>output was generated by some different version of PostgreSQL and now the</div><div>line number in the expected notice messages are coming out from different</div><div>line numbers of the PG code.</div><div><br></div><div>So we may need to fix the test cases and I don't find any functionality issues</div><div>or any issue that is caused by the patch</div><div><br></div><div>See the differences in the result and expected outputs</div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Meslo LG L DZ for Powerline";color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">[highgo@6132f8b15f3f extended-query-test]$ diff results/disable-load-balance-off-black-function.data expected/disable-load-balance-off-black-function.data<span class="gmail-Apple-converted-space" style=""> </span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">2c2</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">< <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L <b>491</b> R does_not_exist_skipping )</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">---</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">> <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L <b>483</b> R does_not_exist_skipping )</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">[highgo@6132f8b15f3f extended-query-test]$ diff results/disable-load-balance-off-black-function.data expected/disable-load-balance-trans-black-function.data</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">2c2</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">< <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L <b>491</b> R does_not_exist_skipping )</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">---</font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">> <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L <b>483</b> R does_not_exist_skipping )</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">[highgo@6132f8b15f3f extended-query-test]$ diff results/disable-load-balance-default.data expected/disable-load-balance-default.data</font></span></p><p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">2c2</font></span></p><p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace" style="">< <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M table "pgproto_test1" does not exist, skipping F tablecmds.c L <b>1186</b> R DropErrorMsgNonExistent )</font></span></p><p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">---</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">
</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">> <= BE NoticeResponse(S NOTICE V NOTICE C 00000 M table "pgproto_test1" does not exist, skipping F tablecmds.c L <b>914</b> R DropErrorMsgNonExistent )</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Meslo LG L DZ for Powerline";color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Thanks</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Best regards</font></span></p><div>...</div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;color:rgb(0,0,0)"><font color="#888888" style="font-size:small"></font></p><div><div style="color:rgb(0,0,0)"><div id="gmail-m_134367682178226378gmail-Zm-_Id_-Sgn"><div><span style="color:rgb(68,68,68)">Muhammad Usama<br></span></div><div><span><span style="font-family:Lato"><span style="font-size:14px"><span style="color:rgb(68,68,68)">Highgo Software (Canada/China/Pakistan)</span><span><span style="color:rgb(68,68,68)"> </span></span></span></span></span><span style="color:rgb(68,68,68)"><br></span></div><div><span><span style="font-family:Lato"><span style="font-size:14px"><span style="color:rgb(68,68,68)">URL :</span><span><span style="color:rgb(68,68,68)"> </span></span></span></span></span><a href="http://www.highgo.ca/" target="_blank" style="color:rgb(89,143,222);font-family:Lato;font-size:14px"><span style="color:rgb(68,68,68)">http://www.highgo.ca</span></a><span><span style="font-family:Lato"><span style="font-size:14px"><span><span style="color:rgb(68,68,68)"> </span></span></span></span></span><span style="color:rgb(68,68,68)"><br></span></div><div><span><span style="font-family:Lato"><span style="font-size:14px"><span style="color:rgb(68,68,68)">ADDR: 10318 WHALLEY BLVD, Surrey, BC</span><span><span style="color:rgb(68,68,68)"> </span></span></span></span></span></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2020 at 6:28 PM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Usama,<br>
<br>
Here is a report on quick tests with your patch.<br>
<br>
1) git apply produced following some warnings.<br>
<br>
/home/t-ishii/pcp_stop_cluster.diff:1984: trailing whitespace.<br>
<br>
/home/t-ishii/pcp_stop_cluster.diff:3919: trailing whitespace.<br>
<br>
/home/t-ishii/pcp_stop_cluster.diff:2882: new blank line at EOF.<br>
+<br>
/home/t-ishii/pcp_stop_cluster.diff:5068: new blank line at EOF.<br>
+<br>
warning: 4 lines add whitespace errors.<br>
<br>
2) compiling produced following warnings.<br>
<br>
wd_escalation.c: In function ‘fork_escalation_process’:<br>
wd_escalation.c:79:2: warning: ‘sigsetmask’ is deprecated [-Wdeprecated-declarations]<br>
POOL_SETMASK(&UnBlockSig);<br>
^~~~~~~~~~~~<br>
In file included from ../../src/include/utils/pool_signal.h:33:0,<br>
from wd_escalation.c:34:<br>
/usr/include/signal.h:173:12: note: declared here<br>
extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;<br>
^~~~~~~~~~<br>
wd_escalation.c: In function ‘fork_plunging_process’:<br>
wd_escalation.c:168:2: warning: ‘sigsetmask’ is deprecated [-Wdeprecated-declarations]<br>
POOL_SETMASK(&UnBlockSig);<br>
^~~~~~~~~~~~<br>
In file included from ../../src/include/utils/pool_signal.h:33:0,<br>
from wd_escalation.c:34:<br>
/usr/include/signal.h:173:12: note: declared here<br>
extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;<br>
^~~~~~~~~~<br>
main/main.c: In function ‘main’:<br>
main/main.c:312:3: warning: implicit declaration of function ‘SSL_ServerSide_init’; did you mean ‘SSL_in_init’? [-Wimplicit-function-declaration]<br>
SSL_ServerSide_init();<br>
^~~~~~~~~~~~~~~~~~~<br>
SSL_in_init<br>
<br>
3) There is a one failure in the regression test.<br>
<br>
testing 010.rewrite_timestamp...failed.<br>
<br>
4) extedend-query-test produces 10 errors.<br>
<br>
t-ishii$ ./test.sh <br>
creating pgpool-II temporary installation ...<br>
moving pgpool_setup to temporary installation path ...<br>
using pgpool-II at /home/t-ishii/work/Pgpool-II/current/pgpool2/src/test/extended-query-test/temp/installed<br>
*************************<br>
REGRESSION MODE : install<br>
PGPOOL-II : /home/t-ishii/work/Pgpool-II/current/pgpool2/src/test/extended-query-test/temp/installed<br>
PostgreSQL bin : /usr/local/pgsql/bin<br>
pgbench : /usr/local/pgsql/bin/pgbench<br>
PostgreSQL jdbc : /usr/local/pgsql/share/postgresql-9.2-1003.jdbc4.jar<br>
*************************<br>
*** creating test database with 2 nodes...done.<br>
statement_level_load_balance = off<br>
testing aborted-transaction.data ... ok.<br>
testing bug370-sql-error-followed-by-select.data ... ok.<br>
testing disable-load-balance-always-black-function.data ... ok.<br>
testing disable-load-balance-always.data ... ok.<br>
testing disable-load-balance-default-black-function.data ... extra test failed.<br>
testing disable-load-balance-default-simple.data ... ok.<br>
testing disable-load-balance-default.data ... extra test failed.<br>
testing disable-load-balance-off-black-function.data ... extra test failed.<br>
testing disable-load-balance-off.data ... ok.<br>
testing disable-load-balance-simple-black-function.data ... ok.<br>
testing disable-load-balance-simple.data ... ok.<br>
testing disable-load-balance-trans-black-function.data ... extra test failed.<br>
testing disable-load-balance-white-function.data ... ok.<br>
testing disable-load-balance.data ... extra test failed.<br>
testing node_js.data ... ok.<br>
testing parse-before-bind-2.data ... ok.<br>
testing parse-before-bind.data ... ok.<br>
testing query-cache-notrans.data ... ok.<br>
testing query-cache.data ... ok.<br>
testing select-multi-rows.data ... ok.<br>
testing sql-error.data ... ok.<br>
testing unable_to_bind.data ... ok.<br>
*** creating test database with 2 nodes...done.<br>
statement_level_load_balance = on<br>
testing aborted-transaction.data ... ok.<br>
testing bug370-sql-error-followed-by-select.data ... ok.<br>
testing disable-load-balance-always-black-function.data ... ok.<br>
testing disable-load-balance-always.data ... ok.<br>
testing disable-load-balance-default-black-function.data ... extra test failed.<br>
testing disable-load-balance-default-simple.data ... ok.<br>
testing disable-load-balance-default.data ... extra test failed.<br>
testing disable-load-balance-off-black-function.data ... extra test failed.<br>
testing disable-load-balance-off.data ... ok.<br>
testing disable-load-balance-simple-black-function.data ... ok.<br>
testing disable-load-balance-simple.data ... ok.<br>
testing disable-load-balance-trans-black-function.data ... extra test failed.<br>
testing disable-load-balance-white-function.data ... ok.<br>
testing disable-load-balance.data ... extra test failed.<br>
testing node_js.data ... ok.<br>
testing parse-before-bind-2.data ... ok.<br>
testing parse-before-bind.data ... ok.<br>
testing query-cache-notrans.data ... ok.<br>
testing query-cache.data ... ok.<br>
testing select-multi-rows.data ... ok.<br>
testing sql-error.data ... ok.<br>
testing unable_to_bind.data ... ok.<br>
creating test database with 3 nodes...done.<br>
testing statement_level_load_balance.data ... ok.<br>
out of 45 ok: 35 failed: 10 timeout: 0.<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
From: Muhammad Usama <<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>><br>
Subject: Re: PCP command to interact with Pgpool-II cluster<br>
Date: Fri, 1 May 2020 15:16:50 +0500<br>
Message-ID: <<a href="mailto:CAEJvTzXWkQhWgJkM%2BcW1cCNeZYbaF_kcE7vVuHvWB5SmNnUeZw@mail.gmail.com" target="_blank">CAEJvTzXWkQhWgJkM+cW1cCNeZYbaF_kcE7vVuHvWB5SmNnUeZw@mail.gmail.com</a>><br>
<br>
> Hi,<br>
> <br>
> While working on the pcp_stop_pgpool command to implement cluster mode,<br>
> I realized that we have a lot of clutter in few source<br>
> files. Especially pool.h include<br>
> file. So I also did some code reorganization and added a bunch of new<br>
> include<br>
> files in the hope to reduce the size of pool.h and also get rid of too many<br>
> global functions.<br>
> <br>
> Along with that, I think there are few other files that need a little<br>
> shredding,<br>
> src/main/pgpool_main.c and src/protocol/child.c are at the top of this<br>
> wanted to be trimmed list.<br>
> So as part of this patch, I have taken a few things related to internal<br>
> commands<br>
> (interface between the child processes can and Pgpool-II main process) from<br>
> pgpool_main.c file and moved them into new "<br>
> src/main/pgpool_internal_commands.c"<br>
> <br>
> Similarly, src/protocol/child.c had and still has so many functions that do<br>
> not fit<br>
> with the personality of child.c file. So I have moved some of the stuff<br>
> related to<br>
> DB functions info src/protocol/pool_pg_utils.c file.<br>
> <br>
> But I think this is still not enough and we may require another round ( if<br>
> someone<br>
> is willing to work on it) of a source file shredding.<br>
> <br>
> Also, I would like to suggest that we just try to refrain from putting<br>
> everything in pool.h<br>
> and only do that if it is absolutely necessary.<br>
> As pool.h is like a global include for Pgpool-II source and in my opinion<br>
> other than few<br>
> struct definitions, Macros, preprocessor Defines, global variable externs<br>
> like pool_config<br>
> there are very few things (especially functions) that really needed to be<br>
> globally<br>
> scoped in Pgpool-II.<br>
> So I would like to suggest that we should at least think twice before<br>
> adding anything to<br>
> pool.h file and consider adding a new include file or even new source file<br>
> if we<br>
> can't find an appropriate existing file for putting in the function we just<br>
> worked up.<br>
> <br>
> Other than lots and lots of core reorganization changes the patch implements<br>
> "--scope=cluster/local" option in the pcp_stop_pgpool command and adds a<br>
> proper<br>
> infrastructure in watchdog for broadcasting the custom commands over the<br>
> watchdog<br>
> cluster to make it easier to implement the --scope=cluster for other PCP<br>
> utilities.<br>
> <br>
> Note on implementing the new command to execute over the watchdog network.<br>
> <br>
> Step 1: Define the command name string<br>
> ============<br>
> Define a new string to identify the command name in<br>
> src/include/watchdog/wd_ipc_defines.h<br>
> <br>
> For example<br>
> <br>
> +#define WD_COMMAND_RESTART_CLUSTE "RESTART_CLUSTER"<br>
> +#define WD_COMMAND_REELECT_MASTER "REELECT_MASTER"<br>
> +#define WD_COMMAND_SHUTDOWN_CLUSTER "SHUTDOWN_CLUSTER"<br>
> <br>
> Step 2: send the command to watchdog<br>
> =========<br>
> Construct the argument list using WDExecCommandArg struct<br>
> and just fire wd_execute_cluster_command() function with your new command<br>
> name<br>
> and argument list.<br>
> See implementation of process_shutown_request() for details<br>
> <br>
> ....<br>
> <br>
> WDExecCommandArg wdExecCommandArg;<br>
> <br>
> <br>
> strncpy(wdExecCommandArg.arg_name, "mode",<br>
> sizeof(wdExecCommandArg.arg_name) - 1);<br>
> <br>
> snprintf(wdExecCommandArg.arg_value, sizeof(wdExecCommandArg.arg_name) - 1,<br>
> "%c",mode);<br>
> <br>
> <br>
> if (wd_execute_cluster_command(WD_COMMAND_SHUTDOWN_CLUSTER,1,<br>
> &wdExecCommandArg) != COMMAND_OK)<br>
> <br>
> ereport(ERROR,<br>
> <br>
> (errmsg("PCP: error while processing shutdown cluster request"),<br>
> <br>
> errdetail("failed to propogate shutdown command through<br>
> watchdog")));<br>
> ...<br>
> <br>
> <br>
> Step 3: Implement the executor<br>
> ===========<br>
> *wd_execute_cluster_command_processor*(..) in watchdog.c is a place where a<br>
> remote<br>
> Pgpool-II would receive a command. So Just verify if its the command you<br>
> are implementing<br>
> by comparing the clusterCommand string as it is done for the shutdown<br>
> command<br>
> <br>
> if (strcasecmp(WD_COMMAND_SHUTDOWN_CLUSTER, clusterCommand) == 0)<br>
> {<br>
> ...<br>
> }<br>
> <br>
> <br>
> @Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>> what are your thoughts on using the<br>
> "--scope=[local | cluster ]" argument<br>
> and also on the code reorganization.<br>
> <br>
> <br>
> Thanks<br>
> Best regards<br>
> ...<br>
> Muhammad Usama<br>
> Highgo Software (Canada/China/Pakistan)<br>
> URL : <a href="http://www.highgo.ca" rel="noreferrer" target="_blank">http://www.highgo.ca</a><br>
> ADDR: 10318 WHALLEY BLVD, Surrey, BC<br>
> <br>
> <br>
> <br>
> <br>
> On Tue, Apr 28, 2020 at 5:30 PM Muhammad Usama <<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>> wrote:<br>
> <br>
>><br>
>><br>
>> On Thu, Apr 23, 2020 at 2:06 PM Muhammad Usama <<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>> wrote:<br>
>> ><br>
>> > On Tue, Apr 21, 2020 at 12:33 PM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>><br>
>> wrote:<br>
>> > ><br>
>> > > Usama,<br>
>> > ><br>
>> > > Thank you for the propsal.<br>
>> > ><br>
>> > > > Hi Hackers,<br>
>> > > ><br>
>> > > > When PCP was first added to Pgpool-II it was meant to manage/control<br>
>> > > > the single Pgpool-II instance.<br>
>> > > > And after the addition of watchdog more often than not multiple<br>
>> > > > Pgpool-II nodes are installed the system<br>
>> > > > and there is not much work/thoughts have gone into the enhancements<br>
>> of<br>
>> > > > the PCP utilities to make<br>
>> > > > them work on the Pgpool-II cluster. So lately I was thinking to<br>
>> > > > enhance/add the PCP utilities to make them<br>
>> > > > more cluster-mode friendly.<br>
>> > > > And for that purpose, I think we would require to add/enhance the<br>
>> > > > following PCP commands.<br>
>> > > ><br>
>> > > > 1- pcp_reload_config<br>
>> > > > ==================<br>
>> > > > The utility to make the whole Pgpool-II cluster to reload the<br>
>> > > > configuration files at once.<br>
>> > > > I think this is required because currently if some installation has<br>
>> > > > let say 3 node Pgpool-II cluster<br>
>> > > > and we want to change one specific configuration parameter ( for<br>
>> > > > example: adding a new backend node)<br>
>> > > > we would require to go on and edit Pgpool configuration files on each<br>
>> > > > node separately and then<br>
>> > > > issue pgpool reload on each node one by one.<br>
>> > > ><br>
>> > > > In my opinion, we need multiple enhancement in this area.<br>
>> > > > We need some mechanisms to let pgpool-II cluster use the centralized<br>
>> > > > configuration<br>
>> > > > ( except watchdog config) or at least a mechanism to push the<br>
>> > > > configuration settings using some<br>
>> > > > new utility like "pcp_load_config" that could take a pgpool.conf file<br>
>> > > > and propagate it to all nodes<br>
>> > > > using watchdog.<br>
>> > ><br>
>> > > Yeah, we definitely need it.<br>
>> > ><br>
>> > > > The centralized configuration part of the problem is a big task and I<br>
>> > > > believe we could take it on after the<br>
>> > > > "simplifying watchdog config" feature that Peng is working on.<br>
>> > > > Meanwhile, I think we can work on pcp_reload_config utility in<br>
>> > > > parallel to make reloading part easier.<br>
>> > ><br>
>> > > +1.<br>
>> > ><br>
>> > > > 2- pcp_restart_pgpool [cluster]<br>
>> > > > ==========================<br>
>> > > > Sometimes, a simple restart solves more problems than any other<br>
>> remedy<br>
>> > > > or debugging.<br>
>> > > > So I think we should have a PCP utility to restart a Pgpool-II node<br>
>> or<br>
>> > > > all node on Pgpool-II cluster.<br>
>> > > > something similar in functionality like "pg_ctl restart" in postgres<br>
>> > ><br>
>> > > +1.<br>
>> > ><br>
>> > > > 3- pcp_watchdog_re-elect<br>
>> > > > ======================<br>
>> > > > What if we want to change the master/coordinator node of the<br>
>> watchdog cluster.<br>
>> > > > There exists no good way for that currently. So I purpose we should<br>
>> > > > have a command to make<br>
>> > > > watchdog re-do the elections. I already had a discussion on this one<br>
>> > > > with Ishii-San sometimes<br>
>> > > > back so I will send a separate proposal for that as well<br>
>> > ><br>
>> > > Looking forward to seeing it.<br>
>> > ><br>
>> > > > 4- pcp_stop_pgpool enhancements<br>
>> > > > ===================<br>
>> > > > pcp_stop_pgpool should be able to stop all the Pgpool-II nodes in<br>
>> > > > Pgpool-II cluster.<br>
>> > > > And for that, I have also cooked up a POC patch which allows the<br>
>> > > > [--all (-a)] option to<br>
>> > > > pcp_stop_pgpool utility and when this --all is specified then the<br>
>> > > > utility stops all the Pgpool-II<br>
>> > > > nodes part of the watchdog cluster.<br>
>> > > > So can you please try the patch and also suggest about the command<br>
>> > > > line option we should<br>
>> > > > use for making the PCP commands interact with cluster rather than the<br>
>> > > > single node.<br>
>> > > > Because I think --all would not be the best choice since it is used<br>
>> by<br>
>> > > > other utilities for a different purpose,<br>
>> > > > and we should come up with new standard command-line switch for all<br>
>> > > > utilities if they want to operate on<br>
>> > > > the cluster rather than on a single node.<br>
>> > ><br>
>> > > +1.<br>
>> > ><br>
>> > > What about:<br>
>> > ><br>
>> > > --cluster, -c /* affect to whole watchdog cluster */<br>
>> > > --local, -l /* affect only to local watchdog cluster */<br>
>> ><br>
>> > Yes seems like a good option since both -c and -l are currently not<br>
>> > used by any PCP utility.<br>
>> ><br>
>> ><br>
>> > ><br>
>> > > We actually need --cluster only but for completeness I feel like we'd<br>
>> > > want to have --local as well (it exactly behaves as PCP commands do<br>
>> > > today).<br>
>> > ><br>
>> > > > Or another way would be to leave the pcp_stop_pgpool utility<br>
>> untouched<br>
>> > > > and add a new utility pcp_stop_cluster ?<br>
>> > > ><br>
>> > > > So what are your suggestions and thoughts on this and do you have<br>
>> > > > other functions especially related to<br>
>> > > > cluster mode of pgpool-II that needed controlling/management using<br>
>> PCP system?<br>
>> > ><br>
>> > > I have tested your patch and it worked as expected. Great!<br>
>> ><br>
>> > Thanks, I will make the argument changes (-c and -l) and push it.<br>
>><br>
>><br>
>> I have been thinking about this further, Instead of introducing -c and -l<br>
>> how about adding new argument scope which can be assigned either local or<br>
>> cluster<br>
>><br>
>> i.e.<br>
>><br>
>> --scope=[local | cluster]<br>
>> and the short form would be -s=[l|c]<br>
>><br>
>> Regards<br>
>> Muhammad Usama<br>
>><br>
>> ><br>
>> ><br>
>> > Best regards<br>
>> > Muhammad Usama<br>
>> ><br>
>> > ><br>
>> > > Best regards,<br>
>> > > --<br>
>> > > Tatsuo Ishii<br>
>> > > SRA OSS, Inc. Japan<br>
>> > > English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
>> > > Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
>><br>
</blockquote></div>