Repository navigation
refactor(cuckoo-filter): move page cache ownership to chain - #3609
Conversation
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.
|
@nagisa-kunhah If #3467 and #3567 don't depend on the code in this PR, then it's not an issue. I just forgot about PR #3467. It looks like the issue was caused by a GitHub service problem. I've already re-triggered it. |
jihuayu
left a comment
There was a problem hiding this comment.
Hi @nagisa-kunhah I've resolved the merge conflicts. Could you please take a look and check if everything looks good? If there are no issues, I'll go ahead and merge the PR.
|
Sorry, I misunderstood. I'll take a look at #3567 after merging this PR. |

Testing
./x.py check formatcmake --build build --target kvrocks -j2cmake --build build --target unittest -j2./build/unittest --gtest_filter='*Cuckoo*'./build/unittestThis PR was written using codex and GPT-5.6 sol