Skip to content

Commit 187b233

Browse files
committed
Read m_m_n from cluster states from 6.7
This completes the BWC serialisation changes required for a 6.7 master to inform other nodes of the node-level value of the `minimum_master_nodes` setting. Relates #37701, #37811
1 parent 0e36adc commit 187b233

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/cluster/ClusterState.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ public static ClusterState readFrom(StreamInput in, DiscoveryNode localNode) thr
804804
Custom customIndexMetaData = in.readNamedWriteable(Custom.class);
805805
builder.putCustom(customIndexMetaData.getWriteableName(), customIndexMetaData);
806806
}
807-
builder.minimumMasterNodesOnPublishingMaster = in.getVersion().onOrAfter(Version.V_7_0_0) ? in.readVInt() : -1;
807+
builder.minimumMasterNodesOnPublishingMaster = in.getVersion().onOrAfter(Version.V_6_7_0) ? in.readVInt() : -1;
808808
return builder.build();
809809
}
810810

@@ -830,7 +830,7 @@ public void writeTo(StreamOutput out) throws IOException {
830830
out.writeNamedWriteable(cursor.value);
831831
}
832832
}
833-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
833+
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
834834
out.writeVInt(minimumMasterNodesOnPublishingMaster);
835835
}
836836
}
@@ -880,7 +880,7 @@ private static class ClusterStateDiff implements Diff<ClusterState> {
880880
metaData = MetaData.readDiffFrom(in);
881881
blocks = ClusterBlocks.readDiffFrom(in);
882882
customs = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER);
883-
minimumMasterNodesOnPublishingMaster = in.getVersion().onOrAfter(Version.V_7_0_0) ? in.readVInt() : -1;
883+
minimumMasterNodesOnPublishingMaster = in.getVersion().onOrAfter(Version.V_6_7_0) ? in.readVInt() : -1;
884884
}
885885

886886
@Override
@@ -894,7 +894,7 @@ public void writeTo(StreamOutput out) throws IOException {
894894
metaData.writeTo(out);
895895
blocks.writeTo(out);
896896
customs.writeTo(out);
897-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
897+
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
898898
out.writeVInt(minimumMasterNodesOnPublishingMaster);
899899
}
900900
}

0 commit comments

Comments
 (0)