-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Make RepositoriesService project-aware #129821
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
base: main
Are you sure you want to change the base?
Conversation
/** | ||
* Apply changes for one project. The project can be either newly added, removed or an existing one. | ||
* | ||
* @param version The cluster state version of the change. | ||
* @param state The current project state, or {@code null} if the project was removed. | ||
* @param previousState the previous project state, or {@code null} if the project was newly added. | ||
*/ | ||
private void applyProjectState(long version, @Nullable ProjectState state, @Nullable ProjectState previousState) { | ||
assert state != null || previousState != null : "state and previousState cannot both be null"; | ||
assert state == null || assertReadonlyRepositoriesNotInUseForWrites(state); |
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 changeset of this method can be a bit deceptively large due to method extraction and indentation difference. It is largely the same as the exisitng applyClusterState
method with some additional logic for new and removed projects.
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.
Most changes are cascading effects from adding projectId to this class and its methods.
'^cat.repositories/*/*', | ||
'^cat.snapshots/*/*', | ||
'^cluster.desired_balance/10_basic/*', | ||
'^cluster.stats/10_basic/snapshot stats reported in get cluster stats', |
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.
Re-mute these repository related YAML tests since they require either create, get or delete snapshots to work in MP setup. Previously these tests passed but it was in fact incorrect because they always target the default project.
'^snapshot.get_repository/20_repository_uuid/*', | ||
'^snapshot.get_repository/*/*', |
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.
Same mute here. They will get unmute again once repositoriy and snapshot are truly MP ready.
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
This PR makes RepositoriesService project aware so that the basic Put, Get, Delete and Verify repository actions are now project scoped.
It intentionally leaves the following aspects out of scope for the current changes:
They will be worked on separately. One main reason for leaving them out is that they are not needed by OBS which is currently blocked by repository/snapshot changes. They may also have their own complexities, e.g. stats reporting.
Resolves: ES-10478