-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Always return metadata version if metadata is requested #37674
Conversation
If the indices of a ClusterStateRequest are specified, we fail to include the cluster state metadata version in the response.
Pinging @elastic/es-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.
There are more oddities here, namely that the metadata settings, templates etc. are not returned when explicit indices are requested. Before we make changes to this API, we need to fully understand the implications though, how this API is being used.
What was the motivation for this PR?
@@ -152,6 +152,7 @@ private void buildResponse(final ClusterStateRequest request, | |||
MetaData.Builder mdBuilder = MetaData.builder(); | |||
mdBuilder.clusterUUID(currentState.metaData().clusterUUID()); | |||
mdBuilder.coordinationMetaData(currentState.coordinationMetaData()); | |||
mdBuilder.version(currentState.metaData().version()); |
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.
why always return it, even if the metadata was not requested?
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 feel that the "version" belongs the metadata group of the metadata just like "clusterUUID".
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.
The cluster uuid is exceptional (because it used in many places for identification purposes), the metadata version not so much (imo), as there is also the cluster state version (that is persisted starting in 7.0). I think we should move mdBuilder.version(currentState.metaData().version());
below if (request.indices().length > 0) {
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 am ok with your suggestion :).
run elasticsearch-ci/1 |
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.
LGTM
@ywelsch Thanks for reviewing this carefully.
I took a look at the Metadata. It may be ok not to return settings and templates if the indices are specified because the settings and templates can be retrieved via |
Let's leave it at this for now, and only introduce once there is a concrete need for it. |
* master: Liberalize StreamOutput#writeStringList (elastic#37768) Add PersistentTasksClusterService::unassignPersistentTask method (elastic#37576) Tests: disable testRandomGeoCollectionQuery on tiny polygons (elastic#37579) Use ILM for Watcher history deletion (elastic#37443) Make sure PutMappingRequest accepts content types other than JSON. (elastic#37720) Retry ILM steps that fail due to SnapshotInProgressException (elastic#37624) Use disassociate in preference to deassociate (elastic#37704) Delete Redundant RoutingServiceTests (elastic#37750) Always return metadata version if metadata is requested (elastic#37674)
If the indices of a ClusterStateRequest are specified, we fail to include the cluster state metadata version in the response. Relates #37633
* elastic/master: (85 commits) Use explicit version for build-tools in example plugin integ tests (elastic#37792) Change `rational` to `saturation` in script_score (elastic#37766) Deprecate types in get field mapping API (elastic#37667) Add ability to listen to group of affix settings (elastic#37679) Ensure changes requests return the latest mapping version (elastic#37633) Make Minio Setup more Reliable (elastic#37747) Liberalize StreamOutput#writeStringList (elastic#37768) Add PersistentTasksClusterService::unassignPersistentTask method (elastic#37576) Tests: disable testRandomGeoCollectionQuery on tiny polygons (elastic#37579) Use ILM for Watcher history deletion (elastic#37443) Make sure PutMappingRequest accepts content types other than JSON. (elastic#37720) Retry ILM steps that fail due to SnapshotInProgressException (elastic#37624) Use disassociate in preference to deassociate (elastic#37704) Delete Redundant RoutingServiceTests (elastic#37750) Always return metadata version if metadata is requested (elastic#37674) [TEST] Mute MlMappingsUpgradeIT testMappingsUpgrade Streamline skip_unavailable handling (elastic#37672) Only bootstrap and elect node in current voting configuration (elastic#37712) Ensure either success or failure path for SearchOperationListener is called (elastic#37467) Target only specific index in update settings test ...
If the indices of a ClusterStateRequest are specified, we fail to include the cluster state metadata version in the response. Relates #37633
If the indices of a ClusterStateRequest are specified, we fail to
include the cluster state metadata version in the response.