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

Require no post-download validation for remote->FSDB #19815

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Sep 10, 2023

This adjusts RemoteStore::download_digest_to_local to enforce that the f_remote validation function is never provided for digests that should be stored in FSDB. This is no-functionality-change, just refactoring things to be slightly clearer and more future-proof.

Previously, this code was conditionalising whether something should be stored in FSDB on more than just the type/size, which could have led to bugs: if we were downloading a digest that should be stored in FSDB, but pass f_remote = Some(...), download_digest_to_local would instead store it in LMDB, and future look-ups of the digest (which don't know about f_remote) would look in FSDB and fail to find it.

However, in practice, we only ever pass f_remote in Store::load_directory, and directories are never stored in the FSDB, even if they're huge, so the extra condition was not changing behaviour. This PR is making the assumption/behaviour/luck here more explicit, and adds a test validating the behaviour of huge directory digests too.

This came out of my investigation of #19748, and, I think, eliminates directories as potential cause of the issues there.

@huonw huonw added the category:internal CI, fixes for not-yet-released features, etc. label Sep 10, 2023
@huonw huonw requested review from stuhood and thejcannon September 10, 2023 11:39
Comment on lines +281 to +282
// this test is ensuring that "huge" directories don't fall into the FSDB code paths, so let's
// ensure we're actually testing that, by validating that a _file_ of this size would use FSDB
Copy link
Member

Choose a reason for hiding this comment

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

Love it

@huonw huonw merged commit be5836a into main Sep 11, 2023
@huonw huonw deleted the huonw/19748-f_remote branch September 11, 2023 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants