<div dir="ltr"><font face="arial, helvetica, sans-serif">Hi Ishii-San</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">This commit made changes to <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">find_primary_node() and after the changes the function returns 0 when no primary backend node is found instead of -1,</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Although the comment on top of the function still suggests that -1 will be returned when no primary is found ( same as was happening before the commit), but now when all the attached nodes are somehow standby and no primary node is present, the function still returns 0 and the caller assumes that node 0 is the primary node.</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Is this change intentional? </span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures"><br></span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Thanks</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Best Regards</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Muhammad Usama</span></font></div><div><font color="#000000" face="Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></font></div><div><font color="#000000" face="Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></font></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 9, 2018 at 1:47 PM Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">First cut of primary server checking.<br>
<br>
For now followings are implemented:<br>
<br>
- Check all backend nodes starting node 0.<br>
<br>
- If primary nodes appear twice or more, the second one or after are<br>
  assumed invalid.<br>
<br>
- Such invalid node will be degenerated at the next convenient<br>
  time. Currently such timing is at the start up of Pgpool-II. This is<br>
  apparently insufficient and should be improved later.<br>
<br>
TODO:<br>
- Verify primary nodes using pg_stat_wal_receiver.<br>
<br>
- More chances to verify node status. Maybe in the same timing as<br>
  streaming replication delay checking?<br>
<br>
- Add new GUCs to control of this feature.<br>
<br>
Branch<br>
------<br>
master<br>
<br>
Details<br>
-------<br>
<a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=f0631a6f260530616a5eb16b1538c2eb15abbac2" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=f0631a6f260530616a5eb16b1538c2eb15abbac2</a><br>
<br>
Modified Files<br>
--------------<br>
src/include/pool.h                            |  16 +-<br>
src/main/pgpool_main.c                        | 201 +++++++++++++++-----------<br>
src/streaming_replication/pool_worker_child.c |  61 ++++----<br>
3 files changed, 166 insertions(+), 112 deletions(-)<br>
<br>
_______________________________________________<br>
pgpool-committers mailing list<br>
<a href="mailto:pgpool-committers@pgpool.net" target="_blank">pgpool-committers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-committers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-committers</a><br>
</blockquote></div></div>