Class FollowersChecker
java.lang.Object
org.elasticsearch.cluster.coordination.FollowersChecker
The FollowersChecker is responsible for allowing a leader to check that its followers are still connected and healthy. On deciding that a
follower has failed the leader will remove it from the cluster. We are fairly lenient, possibly allowing multiple checks to fail before
considering a follower to be faulty, to allow for a brief network partition or a long GC cycle to occur without triggering the removal of
a node and the consequent shard reallocation.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFollowersChecker(Settings settings, TransportService transportService, Consumer<FollowersChecker.FollowerCheckRequest> handleRequestAndUpdateState, BiConsumer<DiscoveryNode,String> onNodeFailure, NodeHealthService nodeHealthService)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the set of known nodes, stopping all checks.void
setCurrentNodes(DiscoveryNodes discoveryNodes)
Update the set of known nodes, starting to check any new ones and stopping checking any previously-known-but-now-unknown ones.toString()
void
updateFastResponseState(long term, Coordinator.Mode mode)
The system is normally in a state in which every follower remains a follower of a stable leader in a single term for an extended period of time, and therefore our response to every follower check is the same.
-
Field Details
-
FOLLOWER_CHECK_ACTION_NAME
- See Also:
- Constant Field Values
-
FOLLOWER_CHECK_INTERVAL_SETTING
-
FOLLOWER_CHECK_TIMEOUT_SETTING
-
FOLLOWER_CHECK_RETRY_COUNT_SETTING
-
-
Constructor Details
-
FollowersChecker
public FollowersChecker(Settings settings, TransportService transportService, Consumer<FollowersChecker.FollowerCheckRequest> handleRequestAndUpdateState, BiConsumer<DiscoveryNode,String> onNodeFailure, NodeHealthService nodeHealthService)
-
-
Method Details
-
setCurrentNodes
Update the set of known nodes, starting to check any new ones and stopping checking any previously-known-but-now-unknown ones. -
clearCurrentNodes
public void clearCurrentNodes()Clear the set of known nodes, stopping all checks. -
updateFastResponseState
The system is normally in a state in which every follower remains a follower of a stable leader in a single term for an extended period of time, and therefore our response to every follower check is the same. We handle this case with a single volatile read entirely on the network thread, and only if the fast path fails do we perform some work in the background, by notifying the FollowersChecker whenever our term or mode changes here. -
getFaultyNodes
- Returns:
- nodes in the current cluster state which have failed their follower checks.
-
toString
-