[pgpool-general: 2628] master - master mode

Tomoyuki Sakurai tomoyukis at reallyenglish.com
Thu Mar 13 14:55:05 JST 2014


hi,

my understanding is that pgpool thinks it is the master when it has
promoted itself. however, there is a use-case where both pgpool nodes
are master and queries are sent to only one.

back ground:

opposed to the official doc, i do not use "ifconfig alias" way to do
failover. the virtual IP address is NOT managed by pgpool. the reason
is that, when pgpool is not running and the kernel is running fine,
there is no way for the slave to take over the virtual IP address.
what slave pgpool can do is, creating an alias IP address. however,
this does not work because the master kernel still responds to packets
to the virtual IP address. this can happen in various scenarios (file
descriptor exhaustion, disk failure, etc).

to solve this problem, we use carp(4), which is similar to VRRP in
linux world. with carp(4), the slave can take over the virtual IP
address. in this case, both pgpool nodes accept queries regardless
whether it is master or not. IP address failover can be done by either
pgpool (watchdog failure) or the kernel (carp(4) timeout), which is
the problem.

the problem:

when the slave, takes over the virtual IP while pgpool on the master
is running but failed to responds to watchdog health check, everything
works fine. however, when the kernel of the slave takes over the IP
address because the other kernel is overloaded, the pgpool on the
master still thinks it is the master. while the failover works fine,
the next failover will NOT happen because the old master does not care
of the old slave. to work around, you need to tell the old master that
it is a slave.

it would be nice for pgpool to be able to handle master-master mode.
does anyone use VRRP or carp(4)?

-- 
Tomoyuki Sakurai


More information about the pgpool-general mailing list