Skip to content

Implement dangling indices API #50920

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

Merged
merged 107 commits into from
Jun 16, 2020

Conversation

pugnascotia
Copy link
Contributor

@pugnascotia pugnascotia commented Jan 13, 2020

Part of #48366. Implement an API for managing dangling indices.

I've been staring at this code for a while so I'd really appreciate some feedback. Note that I haven't (yet) implemented wildcard restores, or written API documentation.

@pugnascotia pugnascotia added :Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. v8.0.0 labels Jan 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Recovery)

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I've left some comments and items to discuss.

We should break this into smaller reviewable chunks once we agree on the direction.

clusterService.addListener(this);
} else {
logger.warn(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey() + " is disabled, dangling indices will not be detected or imported");
clusterService.addListener(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that dangling indices scanning is still done on every cluster state update. One of the benefits of this PR was that this now would only needed to be done on-demand, i.e. when a user requests the list of dangling indices, not on every CS update.

Copy link
Contributor

Choose a reason for hiding this comment

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

This still needs addressing. I agree that we can hunt for dangling indices on demand for the List action, and also load just the specific metadata needed for the Find action. The DanglingIndicesState is effectively a cache, but I don't think we need to cache anything.

We could follow-up with something that checks for dangling indices at startup or periodically if we feel it's needed.

@rjernst rjernst added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 4, 2020
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Thanks @pugnascotia, I left a handful of small comments. Apart from that I'm 100% ok with the new APIs and all that infrastructure. I'll need another opinion on the changes to the existing code as I'm finding it very hard to follow all the different states that we can be in while deleting an index.

@pugnascotia
Copy link
Contributor Author

After talking to @DaveCTurner, I've removed the log line in question, as well as fix a test break. I believe there are now no outstanding issues on this PR.

@pugnascotia
Copy link
Contributor Author

@DaveCTurner @ywelsch is there anything else you'd like to see changed on this PR?

@ywelsch
Copy link
Contributor

ywelsch commented Jun 16, 2020

Once this is merged, we should also add the LIST API to the support diagnostics tool.

@ywelsch ywelsch requested review from DaveCTurner and ywelsch June 16, 2020 13:31
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Thanks @pugnascotia, this LGTM :)

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I've only checked the core changes in IndicesClusterStateService, ClusterChangedEvent and DanglingIndicesState, which looked good to me.

@pugnascotia pugnascotia merged commit ebe8951 into elastic:master Jun 16, 2020
@pugnascotia pugnascotia deleted the 48366-dangling-indices-api branch June 16, 2020 14:19
pugnascotia added a commit that referenced this pull request Jun 16, 2020
Backport of #50920. Part of #48366. Implement an API for listing,
importing and deleting dangling indices.

Co-authored-by: David Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants