nagisa-kunhah opened a new pull request, #3567:
URL: https://github.com/apache/kvrocks/pull/3567
part of: #3552
## Summary
Add RedisBloom-compatible `CF.DEL key item` support for Cuckoo Filter.
`CF.DEL` deletes one matching fingerprint occurrence and returns `1` when a
slot is cleared, or `0` when the key/item
is not found. Duplicate inserts require duplicate deletes, matching
RedisBloom behavior.
## Design
The command layer adds `cf.del` as a write command and delegates deletion to
`CuckooChain::Delete`.
Deletion loads the Cuckoo Filter metadata, hashes the item, generates the
fingerprint, then searches sub-filters from
newest to oldest. The first matching slot in either candidate bucket is
cleared, and only one occurrence is removed.
After a successful delete, metadata size is decremented and
`num_deleted_items` is incremented. When the chain has
more than one sub-filter and accumulated deletes exceed 10% of the remaining
item count, an internal compact pass is
triggered. Compact tries to move fingerprints from newer sub-filters into
older ones, removes fully compacted latest
sub-filters, and deletes their persisted page keys to avoid stale data if
the chain expands again later.
Page key construction is shared through small Cuckoo page helpers so compact
cleanup uses the same encoding as normal
page access.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]