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

gc_compaction: race between compaction and determining gc horizon #10030

Closed
Tracked by #9114
skyzh opened this issue Dec 5, 2024 · 0 comments · Fixed by #10052
Closed
Tracked by #9114

gc_compaction: race between compaction and determining gc horizon #10030

skyzh opened this issue Dec 5, 2024 · 0 comments · Fixed by #10052
Assignees
Labels
t/bug Issue Type: Bug

Comments

@skyzh
Copy link
Member

skyzh commented Dec 5, 2024

If compaction includes the SLRU range while gc interval is set to a small value, we can see errors.

@skyzh skyzh added the t/bug Issue Type: Bug label Dec 5, 2024
@skyzh skyzh self-assigned this Dec 5, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 9, 2024
## Problem

close #10049, close
#10030, close
#8861

part of #9114

The legacy gc process calls `get_latest_gc_cutoff`, which uses a Rcu
different than the gc_info struct. In the gc_compaction_smoke test case,
the "latest" cutoff could be lower than the gc_info struct, causing
gc-compaction to collect data that could be accessed by
`latest_gc_cutoff`. Technically speaking, there's nothing wrong with
gc-compaction using gc_info without considering latest_gc_cutoff,
because gc_info is the source of truth. But anyways, let's fix it.

## Summary of changes

* gc-compaction uses `latest_gc_cutoff` instead of gc_info to determine
the gc horizon.
* if a gc-compaction is scheduled via tenant compaction iteration, it
will take the gc_block lock to avoid racing with functionalities like
detach ancestor (if it's triggered via manual compaction API without
scheduling, then it won't take the lock)

---------

Signed-off-by: Alex Chi Z <[email protected]>
Co-authored-by: Arpad Müller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Issue Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant