-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use query param instead of a system property for opting in for new cluster health response code #79351
Use query param instead of a system property for opting in for new cluster health response code #79351
Conversation
…uster health response code
e43fefc
to
7bfe441
Compare
@elasticmachine update branch |
Pinging @elastic/clients-team (Team:Clients) |
Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few small comments.
server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java
Show resolved
Hide resolved
…alth/ClusterHealthResponse.java Co-authored-by: David Turner <[email protected]>
93e69ba
to
95652e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add the following YAML REST test too:
diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml
index 66a7cb2b48d..6bd4f5fdb8e 100644
--- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml
+++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml
@@ -35,3 +35,23 @@
- match: { initializing_shards: 0 }
- match: { unassigned_shards: 0 }
- gte: { number_of_pending_tasks: 0 }
+
+
+---
+"cluster health request timeout with 200 response code":
+ - do:
+ cluster.health:
+ timeout: 1ms
+ wait_for_active_shards: 5
+ return_200_for_cluster_health_timeout: true
+
+ - is_true: cluster_name
+ - is_true: timed_out
+ - gte: { number_of_nodes: 1 }
+ - gte: { number_of_data_nodes: 1 }
+ - match: { active_primary_shards: 0 }
+ - match: { active_shards: 0 }
+ - match: { relocating_shards: 0 }
+ - match: { initializing_shards: 0 }
+ - match: { unassigned_shards: 0 }
+ - gte: { number_of_pending_tasks: 0 }
Other than that, LGTM.
...ck/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAliasTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterHealthAction.java
Outdated
Show resolved
Hide resolved
…ml/utils/MlIndexAndAliasTests.java Co-authored-by: David Turner <[email protected]>
…er/RestClusterHealthAction.java Co-authored-by: David Turner <[email protected]>
…eout query parameter
Thanks a bunch, David! |
💔 Backport failed
You can use sqren/backport to manually backport by running |
…new cluster health response code Backport elastic#79351 to 7.x: The original change was implemented in elastic#78940, but we have decided to move from a system property to a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code. Relates elastic#70849
* upstream/master: (34 commits) Add extensionName() to security extension (elastic#79329) More robust and consistent allowAll indicesAccessControl (elastic#79415) Fix circuit breaker leak in MultiTerms aggregation (elastic#79362) guard geoline aggregation from parents aggegator that emit empty buckets (elastic#79129) Vector tiles: increase the size of the envelope used to clip geometries (elastic#79030) Revert "[ML] Add queue_capacity setting to start deployment API (elastic#79369)" (elastic#79374) Convert token service license object to LicensedFeature (elastic#79284) [TEST] Fix ShardPathTests for MDP (elastic#79393) Fix fleet search API with no checkpints (elastic#79400) Reduce BWC version for transient settings (elastic#79396) EQL: Rename a test class for eclipse (elastic#79254) Use search_coordination threadpool in field caps (elastic#79378) Use query param instead of a system property for opting in for new cluster health response code (elastic#79351) Add new kNN search endpoint (elastic#79013) Disable BWC tests Convert auditing license object to LicensedFeature (elastic#79280) Update BWC versions after backport of elastic#78551 Enable InstantiatingObjectParser to pass context as a first argument (elastic#79206) Move xcontent filtering tests (elastic#79298) Update links to Fleet/Agent docs (elastic#79303) ...
…new cluster health response code (elastic#79397) Backport elastic#79351 to 7.x: The original change was implemented in elastic#78940, but we have decided to move from a system property to a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code. Relates elastic#70849
Documents the deprecation introduced in elastic#78180 and adjusted in elastic#79351.
Trivial follow-up to elastic#79351 that introduced some spots that create fresh empty string arrays.
Trivial follow-up to #79351 that introduced some spots that create fresh empty string arrays.
Trivial follow-up to #79351 that introduced some spots that create fresh empty string arrays.
…r new cluster health response code (elastic#79351)" This reverts commit 8901a99
…r new cluster health response code (elastic#79351)" This reverts commit 8901a99
#78968)" (#80826) * [8.0] Revert "Return 200 OK response code for a cluster health timeout (#78968)" This reverts commit a2c3dae * Revert "Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178) (#80444)" This reverts commit 4102cf7. * Revert "Drop pre-7.2.0 wire format in ClusterHealthRequest (#79551)" This reverts commit b9fbe66. * Revert "Adjust the BWC version for the return200ForClusterHealthTimeout field (#79436)" This reverts commit f60bda5. * Revert "Use query param instead of a system property for opting in for new cluster health response code (#79351)" This reverts commit 8901a99 * Revert "Deprecate returning 408 for a server timeout on `_cluster/health` (#78180)" This reverts commit f266eb3 * Drop pre-7.2.0 wire format in ClusterHealthRequest (#79551) This reverts commit fa4d562. * Revert "[8.0] Disable BWC for #80821 (#80840)"
)" (#80821) * Revert "Return 200 OK response code for a cluster health timeout (#78968)" This reverts commit a2c3dae * Revert "Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178)" This reverts commit 1c711e3. * Revert "Drop pre-7.2.0 wire format in ClusterHealthRequest (#79551)" This reverts commit b9fbe66. * Revert "Adjust the BWC version for the return200ForClusterHealthTimeout field (#79436)" This reverts commit f60bda5. * Revert "Use query param instead of a system property for opting in for new cluster health response code (#79351)" This reverts commit 8901a99 * Revert "Deprecate returning 408 for a server timeout on `_cluster/health` (#78180)" This reverts commit f266eb3 * Drop pre-7.2.0 wire format in ClusterHealthRequest (#79551) This reverts commit fa4d562 * Revert "Disable BWC for #80821 (#80839)" This reverts commit cb0e73e. Co-authored-by: Elastic Machine <[email protected]>
The original change was implemented in #78940, bu we have decided to move from a system property to an a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code.
References #70849