Skip to content

Commit 0174d13

Browse files
committed
Fix BWC for discovery stats
The new discovery stats were pushed to the 6.x branch (currently versioned at 6.1.0) but master was not updated to reflect this. This impacts the mixed-cluster BWC tests because a 6.1.0 node will be trying to send a 7.0.0 node the new discovery stats but the 7.0.0 did not yet understand that it should be reading these when talking to a 6.1.0 node. This commit addresses this, and changes the skip version on the discovery stats REST tests.
1 parent f1e944a commit 0174d13

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public DiscoveryStats(PendingClusterStateStats queueStats, PublishClusterStateSt
4444
public DiscoveryStats(StreamInput in) throws IOException {
4545
queueStats = in.readOptionalWriteable(PendingClusterStateStats::new);
4646

47-
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
47+
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
4848
publishStats = in.readOptionalWriteable(PublishClusterStateStats::new);
4949
} else {
5050
publishStats = null;
@@ -55,7 +55,7 @@ public DiscoveryStats(StreamInput in) throws IOException {
5555
public void writeTo(StreamOutput out) throws IOException {
5656
out.writeOptionalWriteable(queueStats);
5757

58-
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
58+
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
5959
out.writeOptionalWriteable(publishStats);
6060
}
6161
}

rest-api-spec/src/main/resources/rest-api-spec/test/nodes.stats/30_discovery.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
"Discovery stats":
33
- skip:
4-
version: " - 6.99.99"
5-
reason: "published_cluster_states_received is not (yet) in 6.x"
4+
version: " - 6.0.99"
5+
reason: "published_cluster_states_received arrived in 6.1.0"
66
- do:
77
cluster.state: {}
88

0 commit comments

Comments
 (0)