[pgpool-general: 2968] Re: backend_flag for streaming replication

Yugo Nagata nagata at sraoss.co.jp
Wed Jun 25 12:09:14 JST 2014


Hi,

I'm sorry for the late reply.

On Thu, 15 May 2014 14:10:25 +0100
Bruce McAlister <bruce.mcalister at blueface.com> wrote:

> Hi All,
> 
> We are currently testing a postgresql cluster and pgpool cluster. I 
> would just like to clarify the backend_flag parameter suitable for this 
> setup.
> 
> The postgresql cluster is managed as a pacemaker cluster resource using 
> pgsql resource agent, this manages the startup/shutdown/failover of the 
> postgresql master instace and synchronous slaves. The postgresql version 
> is 9.3.4 and is configured in streaming replication mode.
> 
> The pgpool cluster is setup using the pgpool-ii-ha resource agent (v2.2) 
> which is also magaed by pacemaker.
> 
> I have been reading the pgpool doc's and it appears that the 
> 'DISALLOW_TO_FAILOVER' parameter is the recommended setting for 
> backend_flag for a host definition. I presume that this is because 
> pgpool will not need to perform any sort of recovery operations in case 
> a postgresql node failed.
> 
> If I set the DISALLOW_TO_FAILOVER parameter, will pgpool continue to 
> probe for the new master if there was a failure. For example, if db node 
> 0 was master and db node 1 & 2 were slaves, then postgresql fails on the 
> master node, the cluster promotes db node 1 as the new master, will 
> pgpool reconnect the sessions and active db node 1 as the new write master.

Yes. However, node 0 must be recovered by the cluster software before
pgpool accepts new connection from clients.

> 
> Currently with the testing we have done thus far, pgpool is doing this 
> correctly, but I have just noticed that my backen_flag setting is 
> 'ALLOW_TO_FAILOVER' so pgpool is firing it's recovery steps. 
> Additionally, in this mode, I need to pcp_attach_node once the failed db 
> node is recovered.

In this case, pcp_attach_node is needed since down db is detached when
ALLOW_TO_FAILOVER is used.

> 
> How does pgpool handle this scenario when DISALLOW_TO_FAILOVER is the 
> parameter in use? Do I also need to run pcp_attach_node in  this mode if 
> the system failes over a db node?

Wnen DISALLOW_TO_FAILOVER is used:

(1) Even when a backend node goes down, the node never be detached by
connection error, healthcheck failure, or pcp_detachd_node.

(2) However, new connections from clients are rejected since pgpool can't
create connections to backends.

(3) pgpool can accept new connections **after** the node is recovered
by cluster softwre (e.g. pacemaker) or manually. pcp_attach_node isn't
needed since the node never be detached.

> 
> Your thoughts and comments are appreciated :)
> 
> Thanks
> Bruce
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-general mailing list