fix(gc) - fix the chunk_tail <= tail invariant #12207
Merged
+7
−1
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.
According to this line in the storage checker, the chunk tail should always be less or equal than the tail:
nearcore/chain/chain/src/store_validator/validate.rs
Line 146 in 99ecfa4
This invariant is broken, I'm guessing since #12025 as shown by nayduck gc test failing at this check:
https://nayduck.nearone.org/#/test/108874 - test1 stderr last line
This is a simple mitigation but I'm not 100% sure if correct - please let me know if it makes sense or not.
Even if not entirely correct it should not cause any problems. At worst gc will attempt to clean a little bit more data that isn't there. I hope.
The only real change here is the added
saturating_sub(1)
to the line where we set the tail.