-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Migrate the reserved repository action to be per-project #130155
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
Migrate the reserved repository action to be per-project #130155
Conversation
Resolves: ES-10479
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
@Override | ||
protected void validateForReservedState(DeleteRepositoryRequest request, ClusterState state) { | ||
super.validateForReservedState(request, state); | ||
|
||
validateForReservedState( | ||
projectResolver.getProjectMetadata(state).reservedStateMetadata().values(), | ||
reservedStateHandlerName().get(), | ||
modifiedKeys(request), | ||
request.toString() | ||
); | ||
} |
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.
@@ -36,7 +35,7 @@ | |||
* It is used by the ReservedClusterStateService to add/update or remove snapshot repositories. Typical usage | |||
* for this action is in the context of file based settings. | |||
*/ | |||
public class ReservedRepositoryAction implements ReservedClusterStateHandler<List<PutRepositoryRequest>> { | |||
public class ReservedRepositoryAction implements ReservedProjectStateHandler<List<PutRepositoryRequest>> { |
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.
Basic question. In a non-MP stateless cluster, this is still sufficient because now the cluster back up repo falls under the "default" project?
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.
Yes. Additionally, we have ProjectClusterStateHandlerAdapter which reads the reserved state from the main settings.json
file in a non-MP setup.
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 is correct, no need to explicitly handle the non-MP case.
@elasticmachine update branch |
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
@@ -36,7 +35,7 @@ | |||
* It is used by the ReservedClusterStateService to add/update or remove snapshot repositories. Typical usage | |||
* for this action is in the context of file based settings. | |||
*/ | |||
public class ReservedRepositoryAction implements ReservedClusterStateHandler<List<PutRepositoryRequest>> { | |||
public class ReservedRepositoryAction implements ReservedProjectStateHandler<List<PutRepositoryRequest>> { |
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 is correct, no need to explicitly handle the non-MP case.
@elasticmachine update branch |
Resolves: ES-10479