<div dir="ltr">Hi Ishii-San<div><br></div><div>Please find the attached WIP patch to allow the same name configuration parameters <span style="font-size:12.800000190734863px">with and without index postfix along with the integration of all newly added health_check_* parameters. </span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">To implement the same name parameter with and without index postfix is that, The patch makes adds the following to the config framework.</span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">-- All the array type config (</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">config_int_array, </span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">config_string_array ...)</span><span style="font-size:12.800000190734863px"> parameters can be configured to allow the setting of values with the same name but with out providing the index.</span></div><div><span style="font-size:12.800000190734863px">-- This same named config parameter with and without index postfix must be of same data type.</span></div><div><span style="font-size:12.800000190734863px">-- The indexed (array) parameters and the same name parameter without index postfix can be made independent and also the index free one can be entangled with array.</span></div><div><span style="font-size:12.800000190734863px">-- The new </span><span style="color:rgb(120,73,42);font-family:menlo;font-size:11px">DEFAULT_FOR_NO_VALUE_ARRAY_VAR </span><span style="font-size:12.800000190734863px">flag enables the </span><span style="font-size:12.800000190734863px">index free value of the array type record to serve as the default value for all indexes for which the value is not provided </span></div><div><span style="font-size:12.800000190734863px">-- If the value for index free (same name parameter but without index postfix) is updated in the session and </span><span style="color:rgb(120,73,42);font-family:menlo;font-size:11px">DEFAULT_FOR_NO_VALUE_ARRAY_VAR</span><span style="font-size:12.800000190734863px"> flag is set the value of all indexes which are not provided by user are also updated for the session.</span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><div><span style="font-size:12.800000190734863px">Note that it is still a WIP patch, Although the functionality is complete from my side but it needs little cleanup and also more testing, but I want to share the early version with you to make sure the patch follows the same philosophy as</span><span style="font-size:12.800000190734863px"> envisioned by you for the type of configuration parameter.</span></div></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">Thanks</span></div><div><span style="font-size:12.800000190734863px">Best regards</span></div><div><span style="font-size:12.800000190734863px">Muhammad Usama</span></div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 26, 2017 at 5:32 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt; On Tue, Apr 25, 2017 at 7:24 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi Usama,<br>
&gt;&gt;<br>
&gt;&gt; &gt; Hi Ishii-San<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am working on config framework modification to allow same name<br>
&gt;&gt; parameters<br>
&gt;&gt; &gt; with and without index postfix, I am almost done with the framework<br>
&gt;&gt; related<br>
&gt;&gt; &gt; changes.<br>
&gt;&gt;<br>
&gt;&gt; Thanks!<br>
&gt;&gt;<br>
&gt;&gt; &gt; And now for testing I need to add one such parameter and I was thinking<br>
&gt;&gt; &gt; instead of using a dummy configuration variable for testing I would<br>
&gt;&gt; rather<br>
&gt;&gt; &gt; add the *health_check_period* and *health_check_period[idx]* so that you<br>
&gt;&gt; &gt; can also use it.<br>
&gt;&gt; &gt; For that can you tell me where do you want to create health_check_period<br>
&gt;&gt; &gt; variable for each backend? Is BackendInfo structure is the right place?<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m working on it for the part. I will push it tomorrow. BTW, unlike<br>
&gt;&gt; BackendInfo, the structure does not need to live on the shared memory.<br>
&gt;&gt;<br>
&gt;<br>
&gt; Sure thanks, And yes you are right  the health_check_period doesn&#39;t needs<br>
&gt; to go in shared memory,<br>
&gt;<br>
&gt; You can just push the structure related changes for the health_check_period<br>
&gt; parameters and I will make it configurable, that way it will save you the<br>
&gt; time and also I will be able to test the changes before pushing the changes.<br>
<br>
</span>Thanks. I have just pushed chages to add the data structure along with<br>
sample configuration files changes.<br>
<br>
<a href="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=c0d209d76c67fe10690c33d0a982c0fb3b919544" rel="noreferrer" target="_blank">https://git.postgresql.org/<wbr>gitweb/?p=pgpool2.git;a=<wbr>commit;h=<wbr>c0d209d76c67fe10690c33d0a982c0<wbr>fb3b919544</a><br>
<div class="HOEnZb"><div class="h5"><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_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
<br>
&gt;&gt; &gt; Thanks<br>
&gt;&gt; &gt; Best Regards<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Apr 24, 2017 at 7:42 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; On 21-Apr-2017, at 4:31 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Usama,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Is it possible to have following config parameter at the same time?<br>
&gt;&gt; &gt;&gt; &gt;&gt; My feeling is we can&#39;t because current implementation of config<br>
&gt;&gt; &gt;&gt; &gt;&gt; handling does not allow it.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; health_check_period = 10<br>
&gt;&gt; &gt;&gt; &gt;&gt; health_check_period0 = 5<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Yes, having the same named configuration parameter with and without<br>
&gt;&gt; &gt;&gt; index postfix would cause problem with the current implementations, but<br>
&gt;&gt; if<br>
&gt;&gt; &gt;&gt; we want to support this I can tweak the configuration framework to allow<br>
&gt;&gt; &gt;&gt; that.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; That would be desirable.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Thanks<br>
&gt;&gt; &gt;&gt; &gt; Best regards<br>
&gt;&gt; &gt;&gt; &gt; Muhammad Usama<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; This is a Request for Comments on the new implementation of health<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; check aiming for Pgpool-II 3.7.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Problems:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Current implementation of health check is a single serial processing<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; for all of database nodes. This implies some limitations for health<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; check process: 1) it is not possible to specify different health<br>
&gt;&gt; check<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; configuration values for each database node, 2) node failure<br>
&gt;&gt; detection<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; may take longer. For example, if it takes 10 seconds before<br>
&gt;&gt; detecting<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; node 0 failure, then detecting node 1 failure will be delayed at<br>
&gt;&gt; least<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; 10 seconds because it starts node failure detection after node 0.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; The solution:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Allow to specify health check parameters for each node. Pgpool.conf<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; will look like:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; health_check_period0 = 10<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; health_check_timeout0 = 20<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; :<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; :<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; where &quot;0&quot; means database node 0 (similar concept as &quot;backend_*0<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; parameters).<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; To make admin&#39;s life easier, current parameters can be used as<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; well. Suppose there are 3 nodes, and we have:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; health_check_period = 10<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; health_check_period0 = 5<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; then health_check_period for node 1 and 2 will be 10, while<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; health_check_period for node 0 will be 5. So parameter names without<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; node id works as a &quot;global variable&quot;.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; The implementation:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Create separate child process of pgpool main process and let do the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; heal check job for each database node. Once the health check child<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; process detects node failure, it signals to main process and main<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; process will perform failover.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; This architecture makes pgpool main process simpler and robust,<br>
&gt;&gt; while<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; earlier detection of node failure by the health check child process.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Comments and suggestions are welcome.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; pgpool-hackers mailing list<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers@pgpool.net</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-hackers</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>