Skip to content

MOD-16050 - CF.LOADCHUNK: replicate data chunks (backport to 8.4) - #1020

Merged
gabsow merged 1 commit into
8.4from
tom.gabsow/MOD-16050-cf-loadchunk-8.4
Jun 3, 2026
Merged

gabsow merged 1 commit into
8.4from
tom.gabsow/MOD-16050-cf-loadchunk-8.4

Conversation

@gabsow

@gabsow gabsow commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of MOD-16050 to the 8.4 release branch (cherry-pick of master PR #1014).

Problem: CF.LOADCHUNK replicated only the header chunk, not the data chunks, so a replica of a CF.SCANDUMP/CF.LOADCHUNK-restored cuckoo filter ended up with correct CF.INFO metadata but empty buckets — silent, and exposed as total data loss when a failover promotes the replica.

Fix: add RedisModule_ReplicateVerbatim(ctx) to the data-chunk branch of CFLoadChunk_RedisCommand (mirroring BFLoadChunk_RedisCommand) + a replication regression test (test_cf_loadchunk_replicates_to_replica).

Verified end-to-end on 2.4 (build + test: fails on unpatched, passes with fix); identical change cherry-picked across all release branches. CI will run the regression test here.

Jira: MOD-16050


Note

Medium Risk
Replication correctness for restore/migration paths; wrong behavior caused silent replica data loss on failover, but the change is a small parity fix with existing BF.LOADCHUNK behavior plus a targeted test.

Overview
CF.LOADCHUNK now calls RedisModule_ReplicateVerbatim after successfully applying data chunks (not only the header at position 1), aligning cuckoo restore behavior with BF.LOADCHUNK. Without this, replicas could show correct CF.INFO counts but empty buckets after CF.SCANDUMP / CF.LOADCHUNK migration—silent data loss on failover.

A new integration test test_cf_loadchunk_replicates_to_replica builds a multi-subfilter filter via CF.SCANDUMP, restores it on the master with CF.LOADCHUNK, waits for replication, and asserts all items exist on the replica.

Reviewed by Cursor Bugbot for commit 3dd3389. Bugbot is set up for automated code reviews on this repo. Configure here.

…oss on failover)

CFLoadChunk_RedisCommand only replicated the header chunk (pos == 1). The
data chunks were applied on the primary but never propagated to replicas /
AOF, so a replica of a CF.LOADCHUNK-restored cuckoo filter ended up with
correct metadata (CF.INFO reports the full item count) but empty buckets.
The divergence was silent - master_link_status:up, equal replication
offsets and matching CF.INFO - until a failover promoted the replica, at
which point every CF.EXISTS missed (a cuckoo filter has no false negatives,
so this is real data loss).

Add RedisModule_ReplicateVerbatim to the data-chunk branch, mirroring
BFLoadChunk_RedisCommand. The RDB/DUMP/RESTORE path was already correct, so
a full resync heals an affected replica; this fix closes the incremental
replication gap. Includes a replication regression test that builds a
filter via CF.LOADCHUNK on the primary and asserts all members are present
on the replica.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

@gabsow
gabsow merged commit 2c0e75a into 8.4 Jun 3, 2026
56 of 58 checks passed
@gabsow
gabsow deleted the tom.gabsow/MOD-16050-cf-loadchunk-8.4 branch June 3, 2026 18:56
@gabsow gabsow mentioned this pull request Jul 23, 2026
2 of 3 tasks
YaacovHazan pushed a commit to redis/redis that referenced this pull request Jul 23, 2026
## Summary

Bumps the RedisBloom pin on `8.4` from `v8.4.5` to `v8.4.8`.

| Module | From | To |
|---|---|---|
| RedisBloom | `v8.4.5` | `v8.4.8` |

## RedisBloom changes
([v8.4.5...v8.4.8](RedisBloom/RedisBloom@v8.4.5...v8.4.8))

- MOD-16050 — Replicate `CF.LOADCHUNK` data chunks to prevent silent
Cuckoo Filter data loss on failover
([#1020](RedisBloom/RedisBloom#1020))
- MOD-13409 — Harden RDB loading, including validation of crafted module
payloads ([#1039](RedisBloom/RedisBloom#1039))

## Test plan

- [x] Confirmed `v8.4.8` exists in RedisBloom
- [x] Validated `modules/redisbloom/Makefile` pins `MODULE_VERSION` to
`v8.4.8`
- [ ] Redis core CI passes with the updated module pin

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Module upgrade touches replication and persistence parsing; failures
could affect Bloom/Cuckoo data durability or availability on load,
though scope is limited to the RedisBloom pin.
> 
> **Overview**
> Bumps the RedisBloom build pin from **v8.4.5** to **v8.4.8** by
updating `MODULE_VERSION` in `modules/redisbloom/Makefile`, so
`get_source` clones and builds the newer upstream tag.
> 
> That range pulls in upstream fixes for **Cuckoo Filter replication**
(`CF.LOADCHUNK` chunks replicated to avoid data loss on failover) and
**stricter RDB load validation** for crafted module payloads.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1f168a9. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants