Class FollowersChecker


public class FollowersChecker extends Object
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.
  • Field Details


      public static final String FOLLOWER_CHECK_ACTION_NAME
      See Also:

      public static final Setting<TimeValue> FOLLOWER_CHECK_INTERVAL_SETTING

      public static final Setting<TimeValue> FOLLOWER_CHECK_TIMEOUT_SETTING

      public static final Setting<Integer> FOLLOWER_CHECK_RETRY_COUNT_SETTING
  • Constructor Details

  • Method Details

    • setCurrentNodes

      public 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.
    • clearCurrentNodes

      public void clearCurrentNodes()
      Clear the set of known nodes, stopping all checks.
    • updateFastResponseState

      public 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. 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

      public Set<DiscoveryNode> getFaultyNodes()
      nodes in the current cluster state which have failed their follower checks.
    • toString

      public String toString()
      toString in class Object