Skip to content

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

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

Conversation

ywangd
Copy link
Member

@ywangd ywangd commented Jun 23, 2025

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:

  • Repository stats reporting
  • Repository clean-up, analysis and integrity verification
  • Repository usages for searchable snapshots and CCR

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

Comment on lines +677 to +686
/**
* 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);
Copy link
Member Author

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.

Copy link
Member Author

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.

Comment on lines +50 to +53
'^cat.repositories/*/*',
'^cat.snapshots/*/*',
'^cluster.desired_balance/10_basic/*',
'^cluster.stats/10_basic/snapshot stats reported in get cluster stats',
Copy link
Member Author

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.

Comment on lines -64 to +66
'^snapshot.get_repository/20_repository_uuid/*',
'^snapshot.get_repository/*/*',
Copy link
Member Author

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.

@ywangd ywangd added >non-issue :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Jun 23, 2025
@ywangd ywangd marked this pull request as ready for review June 23, 2025 06:44
@ywangd ywangd requested review from DaveCTurner and pxsalehi June 23, 2025 06:44
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Jun 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants