<div dir="ltr"><br><br>On Thu, Apr 23, 2020 at 2:06 PM Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt; On Tue, Apr 21, 2020 at 12:33 PM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; Usama,<br>&gt; &gt;<br>&gt; &gt; Thank you for the propsal.<br>&gt; &gt;<br>&gt; &gt; &gt; Hi Hackers,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; When PCP was first added to Pgpool-II it was meant to manage/control<br>&gt; &gt; &gt; the single Pgpool-II instance.<br>&gt; &gt; &gt; And after the addition of watchdog more often than not multiple<br>&gt; &gt; &gt; Pgpool-II nodes are installed the system<br>&gt; &gt; &gt; and there is not much work/thoughts have gone into the enhancements of<br>&gt; &gt; &gt; the PCP utilities to make<br>&gt; &gt; &gt; them work on the Pgpool-II cluster.  So lately I was thinking to<br>&gt; &gt; &gt; enhance/add the PCP utilities to make them<br>&gt; &gt; &gt; more cluster-mode friendly.<br>&gt; &gt; &gt; And for that purpose, I think we would require to add/enhance the<br>&gt; &gt; &gt; following PCP commands.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; 1- pcp_reload_config<br>&gt; &gt; &gt; ==================<br>&gt; &gt; &gt; The utility to make the whole Pgpool-II cluster to reload the<br>&gt; &gt; &gt; configuration files at once.<br>&gt; &gt; &gt; I think this is required because currently if some installation has<br>&gt; &gt; &gt; let say 3 node Pgpool-II cluster<br>&gt; &gt; &gt; and we want to change one specific configuration parameter ( for<br>&gt; &gt; &gt; example: adding a new backend node)<br>&gt; &gt; &gt; we would require to go on and edit Pgpool configuration files on each<br>&gt; &gt; &gt; node separately and then<br>&gt; &gt; &gt; issue pgpool reload on each node one by one.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; In my opinion, we need multiple enhancement in this area.<br>&gt; &gt; &gt; We need some mechanisms to let pgpool-II cluster use the centralized<br>&gt; &gt; &gt; configuration<br>&gt; &gt; &gt; ( except watchdog config) or at least a mechanism to push the<br>&gt; &gt; &gt; configuration settings using some<br>&gt; &gt; &gt; new utility like &quot;pcp_load_config&quot; that could take a pgpool.conf file<br>&gt; &gt; &gt; and propagate it to all nodes<br>&gt; &gt; &gt; using watchdog.<br>&gt; &gt;<br>&gt; &gt; Yeah, we definitely need it.<br>&gt; &gt;<br>&gt; &gt; &gt; The centralized configuration part of the problem is a big task and I<br>&gt; &gt; &gt; believe we could take it on after the<br>&gt; &gt; &gt; &quot;simplifying watchdog config&quot; feature that Peng is working on.<br>&gt; &gt; &gt; Meanwhile, I think we can work on pcp_reload_config utility in<br>&gt; &gt; &gt; parallel to make reloading part easier.<br>&gt; &gt;<br>&gt; &gt; +1.<br>&gt; &gt;<br>&gt; &gt; &gt; 2- pcp_restart_pgpool [cluster]<br>&gt; &gt; &gt; ==========================<br>&gt; &gt; &gt; Sometimes, a simple restart solves more problems than any other remedy<br>&gt; &gt; &gt; or debugging.<br>&gt; &gt; &gt; So I think we should have a PCP utility to restart a Pgpool-II node or<br>&gt; &gt; &gt; all node on Pgpool-II cluster.<br>&gt; &gt; &gt; something similar in functionality like &quot;pg_ctl restart&quot; in postgres<br>&gt; &gt;<br>&gt; &gt; +1.<br>&gt; &gt;<br>&gt; &gt; &gt; 3- pcp_watchdog_re-elect<br>&gt; &gt; &gt; ======================<br>&gt; &gt; &gt; What if we want to change the master/coordinator node of the watchdog cluster.<br>&gt; &gt; &gt; There exists no good way for that currently. So I purpose we should<br>&gt; &gt; &gt; have a command to make<br>&gt; &gt; &gt; watchdog re-do the elections. I already had a discussion on this one<br>&gt; &gt; &gt; with Ishii-San sometimes<br>&gt; &gt; &gt; back so I will send a separate proposal for that as well<br>&gt; &gt;<br>&gt; &gt; Looking forward to seeing it.<br>&gt; &gt;<br>&gt; &gt; &gt; 4- pcp_stop_pgpool enhancements<br>&gt; &gt; &gt; ===================<br>&gt; &gt; &gt; pcp_stop_pgpool should be able to stop all the Pgpool-II nodes in<br>&gt; &gt; &gt; Pgpool-II cluster.<br>&gt; &gt; &gt; And for that, I have also cooked up a POC patch which allows the<br>&gt; &gt; &gt; [--all (-a)] option to<br>&gt; &gt; &gt; pcp_stop_pgpool utility and when this --all is specified then the<br>&gt; &gt; &gt; utility stops all the Pgpool-II<br>&gt; &gt; &gt; nodes part of the watchdog cluster.<br>&gt; &gt; &gt; So can you please try the patch and also suggest about the command<br>&gt; &gt; &gt; line option we should<br>&gt; &gt; &gt; use for making the PCP commands interact with cluster rather than the<br>&gt; &gt; &gt; single node.<br>&gt; &gt; &gt; Because I think --all would not be the best choice since it is used by<br>&gt; &gt; &gt; other utilities for a different purpose,<br>&gt; &gt; &gt; and we should come up with new standard command-line switch for all<br>&gt; &gt; &gt; utilities if they want to operate on<br>&gt; &gt; &gt; the cluster rather than on a single node.<br>&gt; &gt;<br>&gt; &gt; +1.<br>&gt; &gt;<br>&gt; &gt; What about:<br>&gt; &gt;<br>&gt; &gt; --cluster, -c   /* affect to whole watchdog cluster */<br>&gt; &gt; --local, -l     /* affect only to local watchdog cluster */<br>&gt;<br>&gt; Yes seems like a good option since both -c and -l are currently not<br>&gt; used by any PCP utility.<br>&gt;<br>&gt;<br>&gt; &gt;<br>&gt; &gt; We actually need --cluster only but for completeness I feel like we&#39;d<br>&gt; &gt; want to have --local as well (it exactly behaves as PCP commands do<br>&gt; &gt; today).<br>&gt; &gt;<br>&gt; &gt; &gt; Or another way would be to leave the pcp_stop_pgpool utility untouched<br>&gt; &gt; &gt; and add a new utility pcp_stop_cluster ?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; So what are your suggestions and thoughts on this and do you have<br>&gt; &gt; &gt; other functions especially related to<br>&gt; &gt; &gt; cluster mode of pgpool-II that needed controlling/management using PCP system?<br>&gt; &gt;<br>&gt; &gt; I have tested your patch and it worked as expected. Great!<br>&gt;<br>&gt; 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 cluster<div><br></div><div>i.e.</div><div><br><div><font size="4">--scope=[local | cluster]<br>and the short form would be -s=[l|c]<br><br></font>Regards</div><div>Muhammad Usama</div><div> <br>&gt;<br>&gt;<br>&gt; Best regards<br>&gt; Muhammad Usama<br>&gt;<br>&gt; &gt;<br>&gt; &gt; Best regards,<br>&gt; &gt; --<br>&gt; &gt; Tatsuo Ishii<br>&gt; &gt; SRA OSS, Inc. Japan<br>&gt; &gt; English: <a href="http://www.sraoss.co.jp/index_en.php">http://www.sraoss.co.jp/index_en.php</a><br>&gt; &gt; Japanese:<a href="http://www.sraoss.co.jp">http://www.sraoss.co.jp</a></div></div></div>