Repository navigation
Reclaim: a store with NARs and no narinfo blocks the run - #84
Merged
Merged
Conversation
An empty narinfo directory left no references, so every NAR past the minimum age was eligible, and --delete removed them all and exited 0. fileStoreAt refuses a missing directory, but the server's newFileStore recreates it empty when it starts. A scan cannot tell that store from one whose every NAR is unreferenced, and the two want opposite answers, so neither mode proceeds. The README, the module header and the changelog fragment also say a run is not atomic with the server, which the fragment and the header claimed more than.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reclaim-narstreats a store with an emptynarinfo/directory as a store with no references, so every NAR past the minimum age is eligible.--deleteremoves them all and exits 0.fileStoreAtmakes a missing directory an error for this reason, butnewFileStorerecreates a missingnarinfo/empty when the server starts, so a store that lost its narinfos reaches the same plan after any restart.Change
planReclaimreturnsReclaimBlocked:UnresolvedNarInfos, as before, orNoNarInfosfor a store holding NARs and no narinfo. An empty store still plans nothing.reclaim-narsrefuses in both modes, lists and deletes nothing, and exits nonzero, as it does for an unresolved narinfo.There is no override. A store whose every NAR really is unreferenced looks identical, and deleting is right for that store and destroys the other. Removing those NARs by hand is the cheaper mistake to allow.
A run and the server
The README and the module header now state the limit
scanStorealready documents: a run is not atomic with the server. A narinfo that arrives during a run for a NAR past the minimum age loses that NAR, including from upstream'snix copy, which skips a NAR already present. A NAR uploaded again after the listing goes too, since removal does not look at the file again. The changelog fragment said the two rules kept a run safe on a cache in use, which that contradicts.Checks
cabal build all -f server --enable-tests --ghc-options="-Werror", thencabal test -f server --ghc-options="-Werror": pass on macOS arm64, GHC 9.14.1. ormolu 0.9.0.0 and hlint 3.10: clean. ASCII only.narinfo/: with the guard disabled,--deleteremoves the NAR and exits 0. With it, both modes exit 1 and the NAR stays. An empty store reports 0 NARs and exits 0.