Class DiscoveryUpgradeService
- java.lang.Object
-
- org.elasticsearch.cluster.coordination.DiscoveryUpgradeService
-
public class DiscoveryUpgradeService extends java.lang.ObjectDeals with rolling upgrades of the cluster coordination layer. In mixed clusters we prefer to elect the older nodes, but when the last old node shuts down then as long as there are enough new nodes we can assume that they form the whole cluster and define them as the initial configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<TimeValue>BWC_PING_TIMEOUT_SETTINGstatic Setting<java.lang.Boolean>ENABLE_UNSAFE_BOOTSTRAPPING_ON_UPGRADE_SETTING
-
Constructor Summary
Constructors Constructor Description DiscoveryUpgradeService(Settings settings, TransportService transportService, java.util.function.BooleanSupplier isBootstrappedSupplier, JoinHelper joinHelper, java.util.function.Supplier<java.lang.Iterable<DiscoveryNode>> peersSupplier, java.util.function.Consumer<CoordinationMetaData.VotingConfiguration> initialConfigurationConsumer)
-
Method Summary
Modifier and Type Method Description voidactivate(java.util.Optional<DiscoveryNode> lastKnownLeader, ClusterState lastAcceptedClusterState)static DiscoveryNodecreateDiscoveryNodeWithImpossiblyHighId(DiscoveryNode node)Pre-7.0 nodes select the best master by comparing their IDs (as strings) and selecting the lowest one amongst those nodes with the best cluster state version.voiddeactivate()
-
-
-
Constructor Detail
-
DiscoveryUpgradeService
public DiscoveryUpgradeService(Settings settings, TransportService transportService, java.util.function.BooleanSupplier isBootstrappedSupplier, JoinHelper joinHelper, java.util.function.Supplier<java.lang.Iterable<DiscoveryNode>> peersSupplier, java.util.function.Consumer<CoordinationMetaData.VotingConfiguration> initialConfigurationConsumer)
-
-
Method Detail
-
activate
public void activate(java.util.Optional<DiscoveryNode> lastKnownLeader, ClusterState lastAcceptedClusterState)
-
deactivate
public void deactivate()
-
createDiscoveryNodeWithImpossiblyHighId
public static DiscoveryNode createDiscoveryNodeWithImpossiblyHighId(DiscoveryNode node)
Pre-7.0 nodes select the best master by comparing their IDs (as strings) and selecting the lowest one amongst those nodes with the best cluster state version. We want 7.0+ nodes to participate in these elections in a mixed cluster but never to win one, so we lie and claim to have an impossible ID that compares above all genuine IDs.
-
-