Skip to content
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

Add repository metadata integrity check API #92373

Conversation

DaveCTurner
Copy link
Contributor

Relates #52622

@DaveCTurner DaveCTurner added >enhancement WIP :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.7.0 labels Dec 14, 2022
@DaveCTurner DaveCTurner force-pushed the 2022-12-14-blobstore-metadata-integrity-checks branch from 9b6c512 to f861f21 Compare December 14, 2022 16:33
Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

This looks mostly good to me.

I wonder if we risk a concurrent SLM (or other) deletion of files causing false negatives? And perhaps also a concurrent snapshot creation could cause the same?

I am not entirely sure if we could perhaps disregard such explicit concurrent changes somehow? Happy to see it as a refinement too, but then we need this to be clear in documentation.


@Override
protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener) throws Exception {
// TODO add mechanism to block blob deletions while this is running
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And yes you are right that this will yield false errors if blobs are deleted out from underneath us. I need advice from @original-brownbear about whether there's a nice way to prevent that. I mean we could make it a stop-the-world thing like repo cleanup but that seems overkill. In principle we should even be able to let snapshotting continue as long as we just held back any finalisation-time deletes. I just worry that this could be a bigger change to the state machine, which IMO isn't worth making any more complex just for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I also think modifying the state machine for this seems like the wrong choice.

For deletions, I wonder if we could recheck that any missing blobs are still referenced/expected after finding that they are missing? I am not entirely sure of the order, but I think we delete the reference to the file before deleting the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The number of potential anomalies is huge, and not all of them relate to missing blobs, so it's not clear that we can go back through the list and drop all the spurious ones.

I've made it so that it checks (and reports) the repo generation at the end of the analysis, so that at least you can see that the repo changed underneath us and therefore that some anomalies may be expected. I think this plus some docs about it will be sufficient for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

:thu: sounds like a pragmatic solution.

@DaveCTurner DaveCTurner force-pushed the 2022-12-14-blobstore-metadata-integrity-checks branch from 1c96e71 to a42310e Compare December 15, 2022 10:26
@DaveCTurner DaveCTurner force-pushed the 2022-12-14-blobstore-metadata-integrity-checks branch from a42310e to f9024eb Compare December 15, 2022 10:29
@DaveCTurner
Copy link
Contributor Author

Having now used this in anger a bit, I have concluded that reporting problems in logs and the REST response is not the right approach. The volume of information just becomes unmanageable on PiB-scale repositories. I think we should write the results to an index, and it's also super-useful to report some summary information which we could do using the same index.

@DaveCTurner
Copy link
Contributor Author

My WIP implementation has drifted sufficiently far from this branch that I think it best to open a new one at #93735 and close this.

@DaveCTurner DaveCTurner deleted the 2022-12-14-blobstore-metadata-integrity-checks branch February 13, 2023 10:53
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 >enhancement v8.8.0 WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants