[pgpool-general: 3366] Fwd: Difference between Master and Primary nodes

Chris Beauchamp chris at chillibean.tv
Tue Dec 16 00:37:18 JST 2014


Re-sending to include the list too :( Apologies
-----
Hi, thanks for replying - I've attached my pgpool.conf and failover script
 - it's indirectly calling promote.sh on the postgres server which does:

pg_ctl promote

on the target server.

I think the failover script should do more checking as to which node is
failing, and what the master or primary is and was, but I don't know which
I'm meant to be checking

I think I'm getting to roughly under what circumstances I see this: If I
try to pcp_node_attach a server which isn't actually up, it then calls the
failover_command with old and new master as node 0, but old primary as 4
(which is correct) and new master port as the port of node 0. It's also
logging about failback events - in reaction to this:

2014-12-15 15:17:23: pid 1: DETAIL:  connection to host:"10.10.50.229:5702"
failed
2014-12-15 15:17:23: pid 1: LOG:  setting backend node 1 status to NODE DOWN
2014-12-15 15:17:23: pid 1: LOG:  starting degeneration. shutdown host
10.10.50.229(5702)
2014-12-15 15:17:23: pid 1: LOG:  Restart all children
2014-12-15 15:17:23: pid 2210: LOG:  child process received shutdown
request signal 3
2014-12-15 15:17:23: pid 2213: LOG:  child process received shutdown
request signal 3
... lots more of these then...
2014-12-15 15:17:23: pid 1: LOG:  execute command: /dockerfail.rb 1
10.10.50.229 5702 /data1 0 0 10.10.50.229 4 5701 /data0

10.10.50.229:5701 -
1f16e7a97bc686b387612bb268ee41012296adcb1f985406d2613320a8144a0a
server promoting <- output from dockerfail.rb command (id of new master
docker container and output from pg_ctl)
2014-12-15 15:17:23: pid 1: LOG:  failover: set new primary node: 4
2014-12-15 15:17:23: pid 1: LOG:  failover: set new master node: 0

(failover_command is defined as: failover_command = '/dockerfail.rb %d %h
%p %D %M %m %H %P %r %R')

I'm afraid I'm a bit confused!

Thanks

Chris

On 15 December 2014 at 14:12, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Probably there's something wrong with your failover script.
> Please show the pgpool.conf and the failover script.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> > Hi PGPool list,
> >
> > I'm new(ish) to both postgres and pgpool, but learning fast :)
> >
> > I'm trying to setup streaming replication with pgpool, and doing
> automatic
> > failovers etc.
> >
> > I've setup a mostly working configurations (lots of docker containers),
> and
> > a failing master will cause pgpool to promote another slave and then
> > re-direct the other slaves to the new master.
> >
> > However, now, when I kill a slave, and the master *isn't* the first node
> in
> > the pool, I get failover_command called, but with the old and new master
> > ids set to the first node in the pool (which isn't the master in terms of
> > replication), and the old primary node id set the the second (which was
> the
> > master).
> >
> > I then end up with two master nodes, and everything replicating from the
> > wrong node.
> >
> > Is this a bug or a feature? I guess I'm just not clear on the difference
> > between a master node and a primary node - the documentation doesn't seem
> > to be very clear, especially where streaming replication is concerned.
> >
> > Thanks!
> >
> > Chris
> >
> > --
> >
> > *Chris Beauchamp*
> > Systems Administrator
> > ChilliBean Ltd
> >
> > 22, D'Arblay Street, London, W1F 8EQ, United Kingdom
> > tel +44 (0)20 7479 7030  |  mobile +44 (0)7770 643582  |  email
> > chris at chillibean.tv
> >
> > www.chillibean.tv  |  www.chillivault.tv  |  www.sohosoho.tv
> >
> > This email and its attachments may be confidential and are intended
> solely
> > for the use of the individual to whom it is addressed. Any views or
> > opinions expressed are solely those of the author and do not necessarily
> > represent those of Chillibean Limited. If you are not the intended
> >  recipient of this email and its attachments, you must take no action
> based
> > upon them, nor must you copy or show them to anyone. Please contact the
> > sender if you believe you have received this email in error.
> >
> > Chillibean Limited of 10 Livonia Street, London W1F 8AF, United Kingdom
> is
> > a limited company registered in England under No. 4775994 VAT
> Registration
> > No. 835 760 804.
>



-- 

*Chris Beauchamp*
Systems Administrator
ChilliBean Ltd

22, D'Arblay Street, London, W1F 8EQ, United Kingdom
tel +44 (0)20 7479 7030  |  mobile +44 (0)7770 643582  |  email
chris at chillibean.tv

www.chillibean.tv  |  www.chillivault.tv  |  www.sohosoho.tv

This email and its attachments may be confidential and are intended solely
for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Chillibean Limited. If you are not the intended
 recipient of this email and its attachments, you must take no action based
upon them, nor must you copy or show them to anyone. Please contact the
sender if you believe you have received this email in error.

Chillibean Limited of 10 Livonia Street, London W1F 8AF, United Kingdom is
a limited company registered in England under No. 4775994 VAT Registration
No. 835 760 804.



-- 

*Chris Beauchamp*
Systems Administrator
ChilliBean Ltd

22, D'Arblay Street, London, W1F 8EQ, United Kingdom
tel +44 (0)20 7479 7030  |  mobile +44 (0)7770 643582  |  email
chris at chillibean.tv

www.chillibean.tv  |  www.chillivault.tv  |  www.sohosoho.tv

This email and its attachments may be confidential and are intended solely
for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Chillibean Limited. If you are not the intended
 recipient of this email and its attachments, you must take no action based
upon them, nor must you copy or show them to anyone. Please contact the
sender if you believe you have received this email in error.

Chillibean Limited of 10 Livonia Street, London W1F 8AF, United Kingdom is
a limited company registered in England under No. 4775994 VAT Registration
No. 835 760 804.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20141215/d41a6880/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool.conf
Type: application/octet-stream
Size: 33670 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20141215/d41a6880/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dockerfail.rb
Type: text/x-ruby-script
Size: 1201 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20141215/d41a6880/attachment-0001.bin>


More information about the pgpool-general mailing list