From 12bd99bdc274c1993b32d2b1d1d99920b78daf6c Mon Sep 17 00:00:00 2001 From: Muhammad Usama Date: Tue, 3 Oct 2017 21:03:09 +0500 Subject: [PATCH] Documentation update for quorum aware failover feature The commit also renames the configuration parameter enable_multiple_failover_requests_from_node to allow_multiple_failover_requests_from_node --- doc/src/sgml/watchdog.sgml | 120 ++++++++++++++++++++- src/config/pool_config_variables.c | 4 +- src/include/pool_config.h | 2 +- src/sample/pgpool.conf.sample | 2 +- src/sample/pgpool.conf.sample-master-slave | 2 +- src/sample/pgpool.conf.sample-replication | 2 +- src/sample/pgpool.conf.sample-stream | 2 +- src/watchdog/watchdog.c | 6 +- 8 files changed, 129 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/watchdog.sgml b/doc/src/sgml/watchdog.sgml index 09549af60..81bc5b434 100644 --- a/doc/src/sgml/watchdog.sgml +++ b/doc/src/sgml/watchdog.sgml @@ -361,7 +361,7 @@ wd_de_escalation_command is not available prior to - Pgpool-IIV3.5. + Pgpool-II V3.5. This parameter can only be set at server start. @@ -371,6 +371,124 @@ + + Controlling the Failover behavior + + + These settings are used to control the behavior of backend node failover when the watchdog is enabled. + The effect of these configurations is limited to the failover/degenerate requests initiated by + Pgpool-II internally, while the user initiated detach backend requests + (using PCP command) by-pass these configuration settings. + + + + + + failover_when_quorum_exists (boolean) + + failover_when_quorum_exists configuration parameter + + + + + When enabled, Pgpool-II will perform the degenerate/failover on + backend node if the quorum exists. In the absence of the quorum, Pgpool-II + node that detects the backend failure will quarantine the failed backend node until the quorum exists again. + + + The quarantine nodes behaves similar to the detached backend nodes but unlike failed/degenerated backends + the quarantine status is not propagated to the other Pgpool-II nodes in the + watchdog cluster, So even if the backend node is in the quarantine state on one + Pgpool-II node, other Pgpool-II nodes may + still continue to use that backend. + + + Although there are many similarities in quarantine and failover operations, but they both differ in a very + fundamental way. The quarantine operations does not executes the + and silently detaches the problematic node, So in the case when the master backend node is quarantined, the + Pgpool-II will not promote the standby to take over the master responsibilities + and until the master node is quarantined the Pgpool-II will not have + any useable master backend node. + + + Default is on. + + + failover_when_quorum_exists is not available prior to + Pgpool-II V3.7. + + + This parameter can only be set at server start. + + + + + + failover_require_consensus (boolean) + + failover_require_consensus configuration parameter + + + + + When enabled, Pgpool-II will perform the degenerate/failover on a + backend node if the watchdog quorum exists and at-least minimum number of nodes necessary + for the quorum vote for the failover. + + + For example, in a three node watchdog cluster, the failover will only be performed until at + least two nodes ask for performing the failover on the particular backend node. + + + Default is on. + + + failover_require_consensus is not available prior to + Pgpool-II V3.7. and it is only + effective when is enabled + + + This parameter can only be set at server start. + + + + + + allow_multiple_failover_requests_from_node (boolean) + + allow_multiple_failover_requests_from_node configuration parameter + + + + + This parameter works in connection with the + . When enabled, a single Pgpool-II + node can cast multiple votes for the failover. + + + For example, in a three node watchdog cluster, if one Pgpool-II node sends two + failover requests for a particular backend node failover, Both requests will be counted as a separate + vote in the favor of the failover and Pgpool-II will execute the failover, + even if it does not get the vote from any other Pgpool-II node. + + + Default is off. + + + allow_multiple_failover_requests_from_node is not available prior to + Pgpool-II V3.7. and it is only + effective when both and + are enabled + + + This parameter can only be set at server start. + + + + + + + Life checking <productname>Pgpool-II</productname> diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c index 29617c418..3ab803f15 100644 --- a/src/config/pool_config_variables.c +++ b/src/config/pool_config_variables.c @@ -250,11 +250,11 @@ static struct config_bool ConfigureNamesBool[] = NULL, NULL,NULL }, { - {"enable_multiple_failover_requests_from_node", CFGCXT_INIT, FAILOVER_CONFIG, + {"allow_multiple_failover_requests_from_node", CFGCXT_INIT, FAILOVER_CONFIG, "A Pgpool-II node can send multiple failover requests to build consensus.", CONFIG_VAR_TYPE_BOOL,false, 0 }, - &g_pool_config.enable_multiple_failover_requests_from_node, + &g_pool_config.allow_multiple_failover_requests_from_node, false, NULL, NULL,NULL }, diff --git a/src/include/pool_config.h b/src/include/pool_config.h index 148d8d02c..22ea360de 100644 --- a/src/include/pool_config.h +++ b/src/include/pool_config.h @@ -302,7 +302,7 @@ typedef struct { bool use_watchdog; /* Enables watchdog */ bool failover_when_quorum_exists; /* Do failover only when wd cluster holds he quorum */ bool failover_require_consensus; /* Only do failover when majority aggrees */ - bool enable_multiple_failover_requests_from_node; /* One Pgpool-II node can send multiple + bool allow_multiple_failover_requests_from_node; /* One Pgpool-II node can send multiple * failover requests to build consensus */ WdLifeCheckMethod wd_lifecheck_method; /* method of lifecheck. 'heartbeat' or 'query' */ diff --git a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample index 0c09537ab..4a70fd0d6 100644 --- a/src/sample/pgpool.conf.sample +++ b/src/sample/pgpool.conf.sample @@ -561,7 +561,7 @@ failover_require_consensus = true # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change -enable_multiple_failover_requests_from_node = false +allow_multiple_failover_requests_from_node = false # A Pgpool-II node can cast multiple votes # for building the consensus on failover diff --git a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave index 360cba1fd..4e1f86ba8 100644 --- a/src/sample/pgpool.conf.sample-master-slave +++ b/src/sample/pgpool.conf.sample-master-slave @@ -559,7 +559,7 @@ failover_require_consensus = true # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change -enable_multiple_failover_requests_from_node = false +allow_multiple_failover_requests_from_node = false # A Pgpool-II node can cast multiple votes # for building the consensus on failover diff --git a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication index ebf530b6e..68c110681 100644 --- a/src/sample/pgpool.conf.sample-replication +++ b/src/sample/pgpool.conf.sample-replication @@ -560,7 +560,7 @@ failover_require_consensus = true # aggrees on the backend node status change -enable_multiple_failover_requests_from_node = false +allow_multiple_failover_requests_from_node = false # A Pgpool-II node can cast multiple votes # for building the consensus on failover diff --git a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream index f5832c723..cf3a7dc36 100644 --- a/src/sample/pgpool.conf.sample-stream +++ b/src/sample/pgpool.conf.sample-stream @@ -560,7 +560,7 @@ failover_require_consensus = true # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change -enable_multiple_failover_requests_from_node = false +allow_multiple_failover_requests_from_node = false # A Pgpool-II node can cast multiple votes # for building the consensus on failover diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c index bc4f20680..8abb9e362 100644 --- a/src/watchdog/watchdog.c +++ b/src/watchdog/watchdog.c @@ -2265,7 +2265,7 @@ static WDFailoverCMDResults compute_failover_consensus(POOL_REQUEST_KIND reqKind ereport(LOG,( errmsg("failover requires the majority vote, waiting for consensus"), errdetail("failover request noted"))); - if (duplicate && !pool_config->enable_multiple_failover_requests_from_node) + if (duplicate && !pool_config->allow_multiple_failover_requests_from_node) return FAILOVER_RES_CONSENSUS_MAY_FAIL; else return FAILOVER_RES_BUILDING_CONSENSUS; @@ -2311,13 +2311,13 @@ static WDFailoverObject* add_failover(POOL_REQUEST_KIND reqKind, int *node_id_li { *duplicate = true; /* The failover request is duplicate */ - if (pool_config->enable_multiple_failover_requests_from_node) + if (pool_config->allow_multiple_failover_requests_from_node) { failoverObj->request_count++; ereport(LOG,( errmsg("duplicate failover request from \"%s\" node",wdNode->nodeName), errdetail("Pgpool-II can send multiple failover requests for same node"), - errhint("enable_multiple_failover_requests_from_node is enabled"))); + errhint("allow_multiple_failover_requests_from_node is enabled"))); } else { -- 2.39.5