refactor(cuckoo-filter): move page cache ownership to chain - #3609
Open
nagisa-kunhah wants to merge 3 commits into
Open
refactor(cuckoo-filter): move page cache ownership to chain#3609nagisa-kunhah wants to merge 3 commits into
nagisa-kunhah wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The shared cache can retain an unbounded number of clean pages while scanning long filter chains.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Moves cuckoo-filter page-cache ownership to the chain layer, enabling shared staging and atomic persistence.
Changes:
- Shares cached pages across subfilters.
- Adds slot-level rollback for failed kick-outs.
- Separates insertion, expansion, and persistence stages.
File summaries
| File | Description |
|---|---|
src/types/cuckoo_filter_page.h |
Defines undo metadata and cache APIs. |
src/types/cuckoo_filter_page.cc |
Implements slot mutation rollback. |
src/types/cuckoo_filter_sub_filter.h |
Makes subfilters borrow the shared cache. |
src/types/cuckoo_filter_sub_filter.cc |
Preserves staged mutations during rollback. |
src/types/redis_cuckoo_chain.h |
Refactors chain insertion interfaces. |
src/types/redis_cuckoo_chain.cc |
Centralizes cache ownership and persistence. |
tests/cppunit/types/cuckoo_filter_test.cc |
Tests rollback and shared-cache behavior. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| CuckooSubFilter sub_filter(storage_, ctx, ns_key, storage_->IsSlotIdEncoded(), metadata->version, | ||
| metadata->bucket_size, metadata->page_size, current_filter_idx, num_buckets); | ||
| CuckooSubFilter sub_filter(pages, current_filter_idx, num_buckets); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing
./x.py check formatcmake --build build --target kvrocks -j2cmake --build build --target unittest -j2./build/unittest --gtest_filter='*Cuckoo*'./build/unittestThis pr is This PR was written using codex and GPT-5.6 sol