Skip to content
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

Allow passing several reserved state chunks in single process call #124574

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jfreden
Copy link
Contributor

@jfreden jfreden commented Mar 11, 2025

This PR overloads the process method and allows it to be used with several ReservedStateChunks. The purpose is to allow several state chunks to be spread across several files but handled as a single cluster state update by validating and merging them into a single representation of the ReservedStateChunk.

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Mar 11, 2025
@jfreden jfreden changed the title Support reserved state to be spread accross several files Support reserved state to be spread across several files Mar 11, 2025
@jfreden jfreden force-pushed the change_mp_file_processing branch from 2d34177 to 4095a58 Compare March 12, 2025 12:24
@jfreden jfreden changed the title Support reserved state to be spread across several files Allow passing several reserved state chunks in single process call Mar 12, 2025
@@ -187,7 +188,7 @@ public void process(
process(namespace, stateChunk, versionCheck, errorListener);
}

ReservedStateChunk parse(ProjectId projectId, String namespace, XContentParser parser) {
public ReservedStateChunk parse(ProjectId projectId, String namespace, XContentParser parser) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be used by a caller to parse several state chunks before passing them to process.

@@ -518,6 +572,11 @@ void updateErrorState(ErrorState errorState) {
return;
}

if (errorState.projectId().isPresent() && clusterService.state().metadata().hasProject(errorState.projectId().get()) == 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.

This was a bug. If parsing fails for a project that doesn't exist yet, the error state reporting won't work since it's persisted in the project metadata that doesn't exist yet. This case needs to be handled in the caller (multi-project file service).

@jfreden jfreden added the :Core/Infra/Settings Settings infrastructure and APIs label Mar 12, 2025
@jfreden jfreden requested a review from prdoyle March 12, 2025 12:35
@jfreden jfreden marked this pull request as ready for review March 12, 2025 12:35
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Mar 12, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @jfreden, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Settings Settings infrastructure and APIs >enhancement serverless-linked Added by automation, don't add manually Team:Core/Infra Meta label for core/infra team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants