Skip to content

Conversation

alexey-ivanov-es
Copy link
Contributor

As it was noted in #132332 (comment) we have a general principle that API output for a single project should be the same regardless of whether the cluster is non-MP or MP. (However, the reserved metadata merge logic was never properly implemented to support this)
As a result of changes in that PR, response formats diverged. This PR makes the single project GetClusterState API response for MP clusters match the non-MP format

@alexey-ivanov-es alexey-ivanov-es requested review from ywangd, mark-vieira and a team September 1, 2025 13:13
@alexey-ivanov-es alexey-ivanov-es added :Core/Infra/Core Core issues without another label >refactoring v9.2.0 labels Sep 1, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Sep 1, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@@ -39,6 +39,7 @@ public class ClusterStateRequest extends LocalClusterStateRequest implements Ind
private TimeValue waitForTimeout = DEFAULT_WAIT_FOR_NODE_TIMEOUT;
private String[] indices = Strings.EMPTY_ARRAY;
private IndicesOptions indicesOptions = IndicesOptions.lenientExpandOpen();
private boolean multiproject = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusterStateRequest is LocalClusterStateRequest, so doesn't require a new transport version

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Sep 2, 2025
Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay here. I have one question about filtering cluster state.

Comment on lines 114 to +115
params = Map.of(Metadata.CONTEXT_MODE_PARAM, Metadata.CONTEXT_MODE_API, "multi-project", "true");
clusterStateRequest.multiproject(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have the new field, it feels an opportunity to remove the use of XContent parameter here as suggest by the above @FixForMultiProject annotation. It does not need to be this PR.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. I had only some more minor comments.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-ivanov-es alexey-ivanov-es merged commit e046429 into elastic:main Sep 10, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >refactoring serverless-linked Added by automation, don't add manually Team:Core/Infra Meta label for core/infra team v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants