Skip to content

Commit

Permalink
Feature: scheduler: add priority-fencing-delay cluster option
Browse files Browse the repository at this point in the history
This feature addresses the relevant topics and implements the ideas
brought up from:

ClusterLabs/fence-agents#308

This commit adds priority-fencing-delay option (just the option, not the
feature itself).

Enforce specified delay for the fencings that are targeting the lost
nodes with the highest total resource priority in case we don't
have the majority of the nodes in our cluster partition, so that
the more significant nodes potentially win any fencing match,
which is especially meaningful under split-brain of 2-node
cluster. If all the nodes have equal priority, then any
pcmk_delay_base/max configured for the corresponding fencing
resources will be applied. Otherwise as long as it's set, even if
to 0, it takes precedence over any configured pcmk_delay_base/max.
By default, priority fencing delay is disabled.
  • Loading branch information
gao-yan committed Mar 17, 2020
1 parent 949368d commit 1c3fe60
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/crm/msg_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ extern "C" {
# define XML_CONFIG_ATTR_FENCE_REACTION "fence-reaction"
# define XML_CONFIG_ATTR_SHUTDOWN_LOCK "shutdown-lock"
# define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT "shutdown-lock-limit"
# define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY "priority-fencing-delay"

# define XML_ALERT_ATTR_PATH "path"
# define XML_ALERT_ATTR_TIMEOUT "timeout"
Expand Down
15 changes: 15 additions & 0 deletions lib/pengine/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ static pcmk__cluster_option_t pe_opts[] = {
"Setting this to false may lead to a \"split-brain\" situation,"
"potentially leading to data loss and/or service unavailability."
},
{
XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY, NULL, "time", NULL,
NULL, pcmk__valid_interval_spec,
"Enforced fencing delay targeting the lost nodes with the highest total resource priority",
"Enforce specified delay for the fencings that are targeting the lost "
"nodes with the highest total resource priority in case we don't "
"have the majority of the nodes in our cluster partition, so that "
"the more significant nodes potentially win any fencing match, "
"which is especially meaningful under split-brain of 2-node "
"cluster. If all the nodes have equal priority, then any "
"pcmk_delay_base/max configured for the corresponding fencing "
"resources will be applied. Otherwise as long as it's set, even if "
"to 0, it takes precedence over any configured pcmk_delay_base/max."
"By default, priority fencing delay is disabled."
},

{
"cluster-delay", NULL, "time", NULL,
Expand Down

0 comments on commit 1c3fe60

Please sign in to comment.