[pgpool-general: 6099] Re: pgpool failover from node 1 to node 0: incorrect value for %P in version 3.7.3 ?
ishii at sraoss.co.jp
Tue May 22 07:35:35 JST 2018
> I did a test with the modified code and it is now working correctly. I have patched the 3.7.3 code (I patched it manually by editing the main.c on the line shown in your patch file)
Thanks for the report. I will commit the patch soon (and it will
appear in the next minor releases).
> By the way, I found a git repository here https://github.com/pgpool/pgpool2 but I was wondering if this git repo was the real one ? It does not seem to be maintained, is it ?
It is just a copy of the original repository
people who are familiar with Github, wanting to look into the source.
Currently it is maintained manually so sometimes it is outdated. We
plan to update automatically.
SRA OSS, Inc. Japan
> Thanks again for the good support.
> On Saturday, May 19, 2018, 9:33:07 AM GMT+2, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> Have a nice week-end too! I am looking forward to hearing from you
> after coming back. Please don't hesitate to ask me regarding applying
> the patch.
> Best regards,
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
>> Hi Tatsuo
>> Thanks for the prompt response and for the patch ! I am glad you could reproduce it.
>> I am leaving now for a long week-end (monday is holiday in Belgium) and I am not familiar with patches to do it right now, but I'll definitively try when I am back.
>> Have a good week-end
>> On Saturday, May 19, 2018, 3:50:28 AM GMT+2, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>>> I have a problem with pgpool 3.7.2 and pgpool 3.7.3, but not with pgpool 3.7.1 so it might be a bug.
>>> When there is a failover from node 1 to node 0 then the parameter %P (old primary id) which is passed to the failover script is incorrect. It says 0 instead of 1. I encounter the error systematically when I do a first failover from node 0 to node 1, then a recovery of node 0, then a new failover from node 1 to node 0. In this new failover - from node 1 to node 0 - the parameter old_primary_id is not correctly passed.
>>> I have reverted back to pgpool 3.7.1 and the problem has disappeared.
>>> My config, for failover_command, is:
>>> failover_command = '/scripts/failover.sh %d %h %p %D %m %H %M %P %r %R' # Executes this command at failover # Special values: # %d = node id # %h = host name # %p = port number # %D = database cluster path # %m = new master node id # %H = hostname of the new master node # %M = old master node id # %P = old primary node id # %r = new master port number
>>> and in the log I see that the parameter %P is incorrect with pgpool 3.7.3 and pgpool 3.7.2 but that it is correct with pgpool 3.7.1
>>> I can provide more logs and configuration if needed
>>> Kind regards,
>> Thanks for the report. I was able to reproduce the problem. I think
>> problem with 3.7.2 and 3.7.3 is, they pass node id 0 if current
>> primary node's status is down. Of course the status is down because
>> it's the reason why the failover script gets called:-< 3.7.1 does not
>> check the primary node status. So it correctly passes the failed
>> primary node id.
>> I think the fix would be passes the primary node id regardless the
>> status. Attached one line patch does the trick. At least it worked for
>> me. So can you please try it out?
>> Best regards,
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
More information about the pgpool-general