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: filter keys not in shard / not in keyspace #8920

Closed
Tracked by #8002
skyzh opened this issue Sep 4, 2024 · 1 comment · Fixed by #9004 or #9765
Closed
Tracked by #8002

gc-compaction: filter keys not in shard / not in keyspace #8920

skyzh opened this issue Sep 4, 2024 · 1 comment · Fixed by #9004 or #9765
Assignees
Labels
c/storage/pageserver Component: storage: pageserver

Comments

@skyzh
Copy link
Member

skyzh commented Sep 4, 2024

So that we can reclaim spaces taken by #8623 and collect more garbages.

@skyzh skyzh self-assigned this Sep 4, 2024
@skyzh skyzh added the c/storage/pageserver Component: storage: pageserver label Sep 4, 2024
skyzh added a commit that referenced this issue Sep 23, 2024
Part of #8002

Close #8920

Legacy compaction (as well as gc-compaction) rely on the GC process to
remove unused layer files, but this relies on many factors (i.e., key
partition) to ensure data in a dropped table can be eventually removed.

In gc-compaction, we consider the keyspace information when doing the
compaction process. If a key is not in the keyspace, we will skip that
key and not include it in the final output.

However, this is not easy to implement because gc-compaction considers
branch points (i.e., retain_lsns) and the retained keyspaces could
change across different LSNs. Therefore, for now, we only remove aux v1
keys in the compaction process.

## Summary of changes

* Add `FilterIterator` to filter out keys.
* Integrate `FilterIterator` with gc-compaction.
* Add `collect_gc_compaction_keyspace` for a spec of keyspaces that can
be retained during the gc-compaction process.

---------

Signed-off-by: Alex Chi Z <chi@neon.tech>
@skyzh skyzh reopened this Sep 23, 2024
@skyzh
Copy link
Member Author

skyzh commented Sep 23, 2024

we still need to figure out a way to deal with keyspace changes in gc-compaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver
Projects
None yet
1 participant