Skip to content

MOD-16050 - CF.LOADCHUNK: replicate data chunks (backport to 8.2) - #1019

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

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

Conversation

@gabsow

@gabsow gabsow commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of MOD-16050 to the 8.2 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

High Risk
Fixes silent replication gaps on restore paths; wrong behavior caused total data loss after replica promotion until this change.

Overview
Fixes cuckoo filter restore over replication: CF.LOADCHUNK now calls RedisModule_ReplicateVerbatim after loading data chunks (not only the header at pos == 1), matching BF.LOADCHUNK.

Without this, a replica could show correct CF.INFO counts but empty buckets, so failover would drop all items restored via CF.SCANDUMP / CF.LOADCHUNK.

Adds test_cf_loadchunk_replicates_to_replica: master+replica env, multi-chunk restore, WAIT, then asserts all CF.EXISTS on the slave.

Reviewed by Cursor Bugbot for commit 908048b. 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 ba6925c into 8.2 Jun 3, 2026
57 of 58 checks passed
@gabsow
gabsow deleted the tom.gabsow/MOD-16050-cf-loadchunk-8.2 branch June 3, 2026 18:55
@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.2` from `v8.2.12` to `v8.2.15`.

| Module | From | To |
|---|---|---|
| RedisBloom | `v8.2.12` | `v8.2.15` |

## RedisBloom changes
([v8.2.12...v8.2.15](RedisBloom/RedisBloom@v8.2.12...v8.2.15))

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

## Test plan

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Upstream changes affect replication and persistence loading for
Bloom/Cuckoo data; risk is moderate but bounded to the RedisBloom module
pin, not core Redis.
> 
> **Overview**
> Bumps the RedisBloom build pin from **v8.2.12** to **v8.2.15** via
`MODULE_VERSION` in `modules/redisbloom/Makefile`, so CI and packaging
pull the newer upstream release.
> 
> That release includes replication fixes for **`CF.LOADCHUNK`**
(avoiding Cuckoo Filter data loss on failover) and **stricter RDB load
validation** for crafted module payloads.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a95ebed. 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