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

fallback to refreshing narinfo when nar is missing #3969

Closed
wants to merge 1 commit into from

Conversation

domenkozar
Copy link
Member

@domenkozar domenkozar commented Aug 30, 2020

Not sure this is the best way, but it does work :-D

Fixes #1885

@domenkozar domenkozar changed the title test when nar is missing and new narinfo is available fallback to refreshing narinfo when nar is missing Aug 30, 2020
@edolstra
Copy link
Member

Wouldn't this still fail in copyStorePath(), if BinaryCacheStore::narFromPath() returns a NAR with an unexpected hash? Deleting it from the database will only make it work on the next invocation.

@domenkozar
Copy link
Member Author

domenkozar commented Aug 31, 2020

The use case here is that there's a GC on the binary cache meanwhile. So there won't be nar nor narinfo, while Nix will have cached narinfo.

That's why we fallback to deleting the cache entry on 404 and retry.

The case where nar is corrupted is already being handled and if it's not corrupted it should just work?

@domenkozar domenkozar added the bug label Aug 31, 2020
@domenkozar
Copy link
Member Author

@edolstra does that clear up the motivation?

@edolstra
Copy link
Member

edolstra commented Sep 4, 2020

The motivation is clear. I was asking about how this works. How is it that copyStorePath() and SubstitutionGoal don't fail if narFromPath() returns a NAR with an unexpected hash?

@domenkozar
Copy link
Member Author

NoSuchBinaryCacheFile exception is raised inside narFromPath because the nar is missing in the binary cache.

That's when we refresh the narinfo and retry fetching the new nar (the optimization could be to check if nar url differs and not re-fetch it)

@domenkozar
Copy link
Member Author

Note that this would allow deleting nar files that are younger than 30 days, currently that results into Nix not recovering without deleting binary cache sqlite file.

@domenkozar
Copy link
Member Author

@edolstra I'm stuck here as I don't understand your questions.

@stale
Copy link

stale bot commented Jun 2, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 19, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hash mismatch in downloaded path
2 participants