Repository navigation
Cut a provider body after a removal exactly as with none, and remove sessions that hold them - #66
Merged
Merged
Conversation
…sessions that hold them Retention kept back every session that holds provider bodies, because a later body is cut against earlier ones: it copies the front of a chain tip and cites pieces earlier records hold. Those sessions are now removed too, and a body landed after a removal lands as the same record it would with nothing removed. - providerbody.Session.Add takes a skeleton record in its removed record's place: its identity, digest, size, depth, pieces and place among the chain tips, checked as the record was. The bytes of a removed tip or piece come from a Store. - A skeleton keeps a part's too_large state, and a body's manifest as a reader decodes it, with each literal string taken out and every part, piece and copy kept. So a body is accepted or not from its skeleton as it was, and indexes the same. - The session's store, <session>/provider/: tips/<generation>/ keeps every chain tip at a removal, named by its record id, and pieces/ each removed piece a later body cites, named by its digest. A removal keeps the tips before it writes its intent; a collector keeps a removed piece before the first body that cites it lands. Each file replaces what an earlier attempt left, and its directories up to the session's are synced, the errors checked. A removal reclaims earlier tips and the pieces once its files are deleted, and syncs the session directory after its intent goes. - asz verify rebuilds every body that is not removed from the store, counts the bodies a removal in progress deletes, and checks again when a removal changed the session while it read. - The scenario writer and its expectation reader use the store too. The chain tests collect at each scenario's own budget, and the scenario runner builds its comparison root at it.
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.
Step 5 of retention. Until now a session holding provider bodies kept its files, because a later body is cut against earlier ones. Such a session is now removed like any other, and a body landed after a removal lands as the same record it would with nothing removed.
How
Skeletons hold the cutter's state.
providerbody.Session.Addtakes a skeleton record in its record's place: identity, digest, size, depth, pieces by digest, and place among the chain tips. It checks the record as it checked the landed one. A skeleton keeps a part'stoo_largestate, and the manifest as a reader decodes it, with literal strings taken out and everypart,pieceandcopykept.The store under
<session>/provider/:tips/<generation>/holds every chain tip at a removal, named by the SHA-256 of its record id.pieces/holds each removed piece a later body cites, named by its digest.The removal keeps the tips before it writes its intent. The collector keeps a removed piece before the first body citing it lands. Every file is written to replace what an earlier attempt left, and its directories up to the session's are synced, with errors checked. Each file is checked against its digest when read.
Removal order:
asz verifyrebuilds every body that is not removed from the store. It counts the bodies a removal in progress deletes. When a removal changed the session during the check, it checks again, and after four tries it says the result is inconclusive.Tests
pkg/skeleton:Litin capitals, duplicate keys.tests/chain: every scenario with and without removals, at its own budget. A new scenario,provider-bodies-too-large. A crash at every point, with verify run before recovery. A resurrected intent, the final sync, a tip that cannot be kept leaving no intent, and an.sdbuild continued after a removal.internal/storageandinternal/verify: store durability, replacement and lookup; a removal during a verify check; a torn read; an inconclusive result.Each guard was proven by reverting it.
Also fixed
max_delta_bytes.provider-bodies-longneeds 16 KiB for its first request to land whole and be copied.Not in this step
The page cannot yet draw a body landed after a removal that is built from a removed tip or piece. That is step 6.