-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
base: main
Are you sure you want to change the base?
Conversation
2d34177
to
4095a58
Compare
@@ -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) { |
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.
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) { |
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.
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).
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @jfreden, I've created a changelog YAML for you. |
This PR overloads the
process
method and allows it to be used with severalReservedStateChunks
. 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 theReservedStateChunk
.