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 39
39
---
40
40
" cluster health request timeout with 200 response code " :
41
41
- 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"
44
44
- do :
45
45
cluster.health :
46
46
timeout : 1ms
Original file line number Diff line number Diff line change @@ -69,9 +69,7 @@ public ClusterHealthRequest(StreamInput in) throws IOException {
69
69
} else {
70
70
indicesOptions = IndicesOptions .lenientExpandOpen ();
71
71
}
72
- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
73
- return200ForClusterHealthTimeout = in .readBoolean ();
74
- }
72
+ return200ForClusterHealthTimeout = in .readBoolean ();
75
73
}
76
74
77
75
@ Override
@@ -102,11 +100,7 @@ public void writeTo(StreamOutput out) throws IOException {
102
100
if (out .getVersion ().onOrAfter (Version .V_7_2_0 )) {
103
101
indicesOptions .writeIndicesOptions (out );
104
102
}
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 );
110
104
}
111
105
112
106
@ Override
Original file line number Diff line number Diff line change 8
8
9
9
package org .elasticsearch .action .admin .cluster .health ;
10
10
11
- import org .elasticsearch .Version ;
12
11
import org .elasticsearch .action .ActionResponse ;
13
12
import org .elasticsearch .cluster .ClusterState ;
14
13
import org .elasticsearch .cluster .health .ClusterHealthStatus ;
@@ -150,9 +149,7 @@ public ClusterHealthResponse(StreamInput in) throws IOException {
150
149
numberOfInFlightFetch = in .readInt ();
151
150
delayedUnassignedShards = in .readInt ();
152
151
taskMaxWaitingTime = in .readTimeValue ();
153
- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
154
- return200ForClusterHealthTimeout = in .readBoolean ();
155
- }
152
+ return200ForClusterHealthTimeout = in .readBoolean ();
156
153
}
157
154
158
155
/** needed for plugins BWC */
@@ -304,11 +301,7 @@ public void writeTo(StreamOutput out) throws IOException {
304
301
out .writeInt (numberOfInFlightFetch );
305
302
out .writeInt (delayedUnassignedShards );
306
303
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 );
312
305
}
313
306
314
307
@ Override
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public void testRequestReturnsHiddenIndicesByDefault() {
51
51
assertTrue (defaultRequest .indicesOptions ().expandWildcardsHidden ());
52
52
}
53
53
54
+ @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/79454" )
54
55
public void testBwcSerialization () throws Exception {
55
56
for (int runs = 0 ; runs < randomIntBetween (5 , 20 ); runs ++) {
56
57
// 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