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

CNS-368: fixation store fix refcount and deletions #405

Merged
merged 8 commits into from
Apr 19, 2023

Conversation

orenl-lava
Copy link
Contributor

Fix refcount handling: FixationStore entry refcount was half-baked: the latest entries had refcount 0, and the code had special handling to avoid ignoring/removing them.

Fix garbage collection logic for stale entries: (1) When entries get StaleAt field set, set a timer to fire on that block; (2) Whenever such timer fires, scan all versions of the respective index to remove eligible stale versions ("eligible" stale version is one whose preceding version is stale; the oldest version is always "eligible").

@orenl-lava orenl-lava requested review from Yaroms and oren-lava April 8, 2023 13:20
Fixation entry refcount was half-baked: the latest entries had refcount 0, and
the code had special handling to avoid ignoring/removing them; Fixed by adding
proper refcount handling.

Signed-off-by: Oren Laadan <orenl@lavanet.xyz>
Fix the garbage collection logic:

1) When entries get StaleAt field set, set a timer to fire on that block.
2) Whenever such timer fires, scan all versions of the respective index to
remove eligible stale versions.
3) Here, "eligible" stale version is one whose preceding version is stale.
The oldest version is always "eligible".
Now that FixationStore's requires AdvanceBlock() callback, make sure
the current users of FixationStore call it.
@orenl-lava orenl-lava force-pushed the CNS-368-timer-store-introduce branch from b57ccd7 to c8956b6 Compare April 8, 2023 13:52
@orenl-lava orenl-lava force-pushed the CNS-368-fixation-store-fix-refcount branch from c349bf2 to b62c1d9 Compare April 8, 2023 13:53
common/fixation_entry.go Outdated Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
common/fixation_entry.go Outdated Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
common/fixation_entry.go Show resolved Hide resolved
@omerlavanet omerlavanet self-requested a review April 19, 2023 07:25
Base automatically changed from CNS-368-timer-store-introduce to main April 19, 2023 10:59
Copy link
Collaborator

@omerlavanet omerlavanet left a comment

Choose a reason for hiding this comment

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

very very nice

@Yaroms Yaroms merged commit dbea6bf into main Apr 19, 2023
@Yaroms Yaroms deleted the CNS-368-fixation-store-fix-refcount branch April 19, 2023 11:17
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.

4 participants