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

fix(gc) - fix the chunk_tail <= tail invariant #12207

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

wacban
Copy link
Contributor

@wacban wacban commented Oct 11, 2024

According to this line in the storage checker, the chunk tail should always be less or equal than the tail:

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.

@wacban wacban requested a review from a team as a code owner October 11, 2024 13:31
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.76%. Comparing base (99ecfa4) to head (5690fdf).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
chain/chain/src/chain.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12207      +/-   ##
==========================================
+ Coverage   71.69%   71.76%   +0.06%     
==========================================
  Files         825      825              
  Lines      165834   165822      -12     
  Branches   165834   165822      -12     
==========================================
+ Hits       118902   118995      +93     
+ Misses      41751    41631     -120     
- Partials     5181     5196      +15     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (+<0.01%) ⬆️
db-migration 0.17% <0.00%> (+<0.01%) ⬆️
genesis-check 1.26% <0.00%> (+<0.01%) ⬆️
integration-tests 38.93% <75.00%> (+0.08%) ⬆️
linux 71.43% <75.00%> (+0.05%) ⬆️
linux-nightly 71.33% <75.00%> (+0.06%) ⬆️
macos 54.33% <0.00%> (+0.08%) ⬆️
pytests 1.57% <0.00%> (+<0.01%) ⬆️
sanity-checks 1.38% <0.00%> (+<0.01%) ⬆️
unittests 65.51% <0.00%> (+0.14%) ⬆️
upgradability 0.21% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Longarithm
Copy link
Member

That's move in the right direction. To be 100% correct, I think we need to take chunks from new_tail instead of prev_block. This is because previous impl assumed that they are the same, now it is not the case.

@wacban wacban enabled auto-merge October 11, 2024 15:44
@wacban wacban added this pull request to the merge queue Oct 11, 2024
Merged via the queue into master with commit 16fd9e8 Oct 11, 2024
27 of 30 checks passed
@wacban wacban deleted the waclaw-nayduck-gc branch October 11, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants