|
@@ -70,6 +70,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
private final Version minNodeVersion;
|
|
|
private final IndexVersion maxDataNodeCompatibleIndexVersion;
|
|
|
private final IndexVersion minSupportedIndexVersion;
|
|
|
+ private final IndexVersion minReadOnlySupportedIndexVersion;
|
|
|
|
|
|
private final Map<String, Set<String>> tiersToNodeIds;
|
|
|
|
|
@@ -86,6 +87,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
Version minNodeVersion,
|
|
|
IndexVersion maxDataNodeCompatibleIndexVersion,
|
|
|
IndexVersion minSupportedIndexVersion,
|
|
|
+ IndexVersion minReadOnlySupportedIndexVersion,
|
|
|
Map<String, Set<String>> tiersToNodeIds
|
|
|
) {
|
|
|
this.nodeLeftGeneration = nodeLeftGeneration;
|
|
@@ -103,6 +105,8 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
this.maxNodeVersion = maxNodeVersion;
|
|
|
this.maxDataNodeCompatibleIndexVersion = maxDataNodeCompatibleIndexVersion;
|
|
|
this.minSupportedIndexVersion = minSupportedIndexVersion;
|
|
|
+ this.minReadOnlySupportedIndexVersion = minReadOnlySupportedIndexVersion;
|
|
|
+ assert minReadOnlySupportedIndexVersion.onOrBefore(minSupportedIndexVersion);
|
|
|
assert (localNodeId == null) == (localNode == null);
|
|
|
this.tiersToNodeIds = tiersToNodeIds;
|
|
|
}
|
|
@@ -122,6 +126,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
minNodeVersion,
|
|
|
maxDataNodeCompatibleIndexVersion,
|
|
|
minSupportedIndexVersion,
|
|
|
+ minReadOnlySupportedIndexVersion,
|
|
|
tiersToNodeIds
|
|
|
);
|
|
|
}
|
|
@@ -382,6 +387,13 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
return minSupportedIndexVersion;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns the minimum index version for read-only indices supported by all nodes in the cluster
|
|
|
+ */
|
|
|
+ public IndexVersion getMinReadOnlySupportedIndexVersion() {
|
|
|
+ return minReadOnlySupportedIndexVersion;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Return the node-left generation, which is the number of times the cluster membership has been updated by removing one or more nodes.
|
|
|
* <p>
|
|
@@ -841,6 +853,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
Version minNonClientNodeVersion = null;
|
|
|
IndexVersion maxDataNodeCompatibleIndexVersion = null;
|
|
|
IndexVersion minSupportedIndexVersion = null;
|
|
|
+ IndexVersion minReadOnlySupportedIndexVersion = null;
|
|
|
for (Map.Entry<String, DiscoveryNode> nodeEntry : nodes.entrySet()) {
|
|
|
DiscoveryNode discoNode = nodeEntry.getValue();
|
|
|
Version version = discoNode.getVersion();
|
|
@@ -851,6 +864,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
minNodeVersion = min(minNodeVersion, version);
|
|
|
maxNodeVersion = max(maxNodeVersion, version);
|
|
|
minSupportedIndexVersion = max(minSupportedIndexVersion, discoNode.getMinIndexVersion());
|
|
|
+ minReadOnlySupportedIndexVersion = max(minReadOnlySupportedIndexVersion, discoNode.getMinReadOnlyIndexVersion());
|
|
|
}
|
|
|
|
|
|
final long newNodeLeftGeneration;
|
|
@@ -884,6 +898,7 @@ public class DiscoveryNodes implements Iterable<DiscoveryNode>, SimpleDiffable<D
|
|
|
Objects.requireNonNullElse(minNodeVersion, Version.CURRENT.minimumCompatibilityVersion()),
|
|
|
Objects.requireNonNullElse(maxDataNodeCompatibleIndexVersion, IndexVersion.current()),
|
|
|
Objects.requireNonNullElse(minSupportedIndexVersion, IndexVersions.MINIMUM_COMPATIBLE),
|
|
|
+ Objects.requireNonNullElse(minReadOnlySupportedIndexVersion, IndexVersions.MINIMUM_READONLY_COMPATIBLE),
|
|
|
computeTiersToNodesMap(dataNodes)
|
|
|
);
|
|
|
}
|