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(store): check if link exists on write #3844

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

walldiss
Copy link
Member

In case of unexpected shutdown file might be partially written, while link is not. This PR will ensure we that put will result in both link and file on success.

File validation will be tackled in another PR

@walldiss walldiss added area:storage kind:fix Attached to bug-fixing PRs labels Oct 14, 2024
@walldiss walldiss self-assigned this Oct 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 46.56%. Comparing base (2469e7a) to head (7bd0266).
Report is 338 commits behind head on main.

Files with missing lines Patch % Lines
store/store.go 36.36% 2 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3844      +/-   ##
==========================================
+ Coverage   44.83%   46.56%   +1.73%     
==========================================
  Files         265      314      +49     
  Lines       14620    18142    +3522     
==========================================
+ Hits         6555     8448    +1893     
- Misses       7313     8679    +1366     
- Partials      752     1015     +263     

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

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It asks for a test

@Wondertan
Copy link
Member

For context: shwap-robus network has a few blocks missed in the storage, and the hypothesis is that they were missed during OOM leaving the Store in an inconsistent state(file exists, but link for it does not). This covers this possibility and we are yet to prove this is an issue

Copy link
Contributor

@cristaloleg cristaloleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@walldiss walldiss merged commit d7d2db8 into celestiaorg:main Oct 15, 2024
32 checks passed
@walldiss walldiss deleted the check-link-exist-on-write branch October 15, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:storage kind:fix Attached to bug-fixing PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants