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): properly update store head #207

Merged
merged 23 commits into from
Oct 22, 2024
Merged

Conversation

cristaloleg
Copy link
Contributor

@cristaloleg cristaloleg commented Jun 26, 2024

Overview

The main idea of this PR is to make Store[H].Head working properly, to be precise: returning head that was written to the disk (*). Along with that heightSub.height is increased monotonically to prevent bugs when we have store appends out of order.

To test everything I'm adding 2 new tests: one that verifies out of order appends and another when which does this concurrently. Which helped to find 2 or even 3 edge cases during coding.

Fixes #201

@cristaloleg cristaloleg changed the title Store/fix store head fix(store): properly update store head Jun 27, 2024
store/heightsub.go Outdated Show resolved Hide resolved
store/heightsub.go Show resolved Hide resolved
sync/sync_head_test.go Show resolved Hide resolved
store/store_test.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
@cristaloleg cristaloleg marked this pull request as ready for review June 27, 2024 14:51
store/heightsub.go Show resolved Hide resolved
store/store.go Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
renaynay
renaynay previously approved these changes Jul 22, 2024
store/heightsub.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
@cristaloleg cristaloleg force-pushed the store/fix-store-head branch from 964e86f to a197550 Compare October 9, 2024 08:37
store/store.go Outdated Show resolved Hide resolved
store/heightsub.go Outdated Show resolved Hide resolved
store/heightsub.go Show resolved Hide resolved
store/store.go Show resolved Hide resolved
store/heightsub.go Show resolved Hide resolved
store/heightsub_test.go Show resolved Hide resolved
store/store.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 63.82%. Comparing base (88c5b8c) to head (e552672).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
store/store.go 93.10% 2 Missing and 2 partials ⚠️
store/heightsub.go 81.25% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   62.80%   63.82%   +1.01%     
==========================================
  Files          39       38       -1     
  Lines        3589     3621      +32     
==========================================
+ Hits         2254     2311      +57     
+ Misses       1160     1141      -19     
+ Partials      175      169       -6     

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

store/heightsub.go Show resolved Hide resolved
store/store.go Show resolved Hide resolved
sync/sync_test.go Outdated Show resolved Hide resolved
Copy link
Member

@walldiss walldiss left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@cristaloleg cristaloleg enabled auto-merge (squash) October 17, 2024 16:34
@cristaloleg cristaloleg merged commit 18f0eb1 into main Oct 22, 2024
4 checks passed
@cristaloleg cristaloleg deleted the store/fix-store-head branch October 22, 2024 10:56
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.

store: Head of store needs to be the *contiguous* head of the store
6 participants