File tree Expand file tree Collapse file tree 4 files changed +7
-19
lines changed
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health
main/java/org/elasticsearch/action/admin/cluster/health
test/java/org/elasticsearch/action/admin/cluster/health Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 3939---
4040" cluster health request timeout with 200 response code " :
4141 - skip :
42- version : " - 7.99 .99"
43- reason : " return_200_for_cluster_health_timeout exists only in 8.0.0; re-enable in 7.16+ when back-ported "
42+ version : " - 7.15 .99"
43+ reason : " return_200_for_cluster_health_timeout was added in 7.16"
4444 - do :
4545 cluster.health :
4646 timeout : 1ms
Original file line number Diff line number Diff line change @@ -69,9 +69,7 @@ public ClusterHealthRequest(StreamInput in) throws IOException {
6969 } else {
7070 indicesOptions = IndicesOptions .lenientExpandOpen ();
7171 }
72- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
73- return200ForClusterHealthTimeout = in .readBoolean ();
74- }
72+ return200ForClusterHealthTimeout = in .readBoolean ();
7573 }
7674
7775 @ Override
@@ -102,11 +100,7 @@ public void writeTo(StreamOutput out) throws IOException {
102100 if (out .getVersion ().onOrAfter (Version .V_7_2_0 )) {
103101 indicesOptions .writeIndicesOptions (out );
104102 }
105- if (out .getVersion ().onOrAfter (Version .V_8_0_0 )) {
106- out .writeBoolean (return200ForClusterHealthTimeout );
107- } else if (return200ForClusterHealthTimeout ) {
108- throw new IllegalArgumentException ("Can't fix response code in a cluster involving nodes with version " + out .getVersion ());
109- }
103+ out .writeBoolean (return200ForClusterHealthTimeout );
110104 }
111105
112106 @ Override
Original file line number Diff line number Diff line change 88
99package org .elasticsearch .action .admin .cluster .health ;
1010
11- import org .elasticsearch .Version ;
1211import org .elasticsearch .action .ActionResponse ;
1312import org .elasticsearch .cluster .ClusterState ;
1413import org .elasticsearch .cluster .health .ClusterHealthStatus ;
@@ -150,9 +149,7 @@ public ClusterHealthResponse(StreamInput in) throws IOException {
150149 numberOfInFlightFetch = in .readInt ();
151150 delayedUnassignedShards = in .readInt ();
152151 taskMaxWaitingTime = in .readTimeValue ();
153- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
154- return200ForClusterHealthTimeout = in .readBoolean ();
155- }
152+ return200ForClusterHealthTimeout = in .readBoolean ();
156153 }
157154
158155 /** needed for plugins BWC */
@@ -304,11 +301,7 @@ public void writeTo(StreamOutput out) throws IOException {
304301 out .writeInt (numberOfInFlightFetch );
305302 out .writeInt (delayedUnassignedShards );
306303 out .writeTimeValue (taskMaxWaitingTime );
307- if (out .getVersion ().onOrAfter (Version .V_8_0_0 )) {
308- out .writeBoolean (return200ForClusterHealthTimeout );
309- } else if (return200ForClusterHealthTimeout ) {
310- throw new IllegalArgumentException ("Can't fix response code in a cluster involving nodes with version " + out .getVersion ());
311- }
304+ out .writeBoolean (return200ForClusterHealthTimeout );
312305 }
313306
314307 @ Override
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public void testRequestReturnsHiddenIndicesByDefault() {
5151 assertTrue (defaultRequest .indicesOptions ().expandWildcardsHidden ());
5252 }
5353
54+ @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/79454" )
5455 public void testBwcSerialization () throws Exception {
5556 for (int runs = 0 ; runs < randomIntBetween (5 , 20 ); runs ++) {
5657 // Generate a random cluster health request in version < 7.2.0 and serializes it
You can’t perform that action at this time.
0 commit comments