Class NodeVersionAllocationDecider

java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider

public class NodeVersionAllocationDecider extends AllocationDecider
An allocation decider that prevents relocation or allocation from nodes that might not be version compatible. If we relocate from a node that runs a newer version than the node we relocate to this might cause IndexFormatTooNewException on the lowest level since it might have already written segments that use a new postings format or codec that is not available on the target node.
  • Field Details

  • Constructor Details

    • NodeVersionAllocationDecider

      public NodeVersionAllocationDecider()
  • Method Details

    • canAllocate

      public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
      Description copied from class: AllocationDecider
      Returns a Decision whether the given shard routing can be allocated on the given node. The default is Decision.ALWAYS.
      Overrides:
      canAllocate in class AllocationDecider
    • canForceAllocateDuringReplace

      public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
      Description copied from class: AllocationDecider
      Returns a Decision whether the given shard can be forced to the given node in the event that the shard's source node is being replaced. This allows nodes using a replace-type node shutdown to override certain deciders in the interest of moving the shard away from a node that *must* be removed. It defaults to returning "YES" and must be overridden by deciders that opt-out to having their other NO decisions *not* overridden while vacating. The caller is responsible for first checking: - that a replacement is ongoing - the shard routing's current node is the source of the replacement
      Overrides:
      canForceAllocateDuringReplace in class AllocationDecider