Repository navigation
MOD-19328: self-contained saves on cores without persistence flags - #1688
Merged
Merged
Conversation
A core that predates REDISMODULE_PERSISTENCE_FLAG_SYNCER and REDISMODULE_PERSISTENCE_FLAG_STDRDB passes no persistence info, so the module cannot tell that a save feeds a syncer or a backup, both restored one key at a time. require_persistence_flags(), called from an embedding build's init, makes every value of such a save self-contained (reason=no_flags). Flagged cores still stream ordinary saves; OSS does not call it and is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1688 +/- ##
==========================================
- Coverage 87.74% 87.69% -0.05%
==========================================
Files 18 18
Lines 6666 6673 +7
==========================================
+ Hits 5849 5852 +3
- Misses 817 821 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Follow-up to #1682, from review of RedisJSON/RedisJsonHdt#555.
A core that predates
REDISMODULE_PERSISTENCE_FLAG_SYNCERandREDISMODULE_PERSISTENCE_FLAG_STDRDBpasses no persistence info, so the module cannot tell that a save feeds a syncer or a backup. Both are restored one key at a time and refuse stream records.rdb_persistence::require_persistence_flags(), called from an embedding build'sinit, makes every value of a save without persistence info self-contained. The start-of-save log line reportsmode=local reason=no_flags.no_flags.Testing
cargo test -p redis_json --lib: 120 tests, 121 with--features as-library.a_save_without_persistence_info_never_streams_when_the_flags_are_required: with the call, a save without info writes self-contained records; a save with info and no flags still streams.init.🤖 Generated with Claude Code
Note
Medium Risk
Changes when RDB stream vs self-contained encoding is chosen for Enterprise on legacy cores, which affects backup/replica-of compatibility but is intentional and scoped to an explicit init call.
Overview
Adds
rdb_persistence::require_persistence_flags(), an init-time opt-in for embedding builds (e.g. Enterprise) so saves on cores that pass noRedisModulePersistenceInfonever open a cross-key stream session. Those saves write self-contained values instead, because the module cannot tell backup/syncer saves from ordinary BGSAVE on older cores.cross_key_stream_allowednow takes anunflaggedbranch: true when persistence data is null and the flag was set at init. OSS behavior is unchanged if the call is omitted (null data still streams). Saves on cores that do pass persistence info (even with zero flags) still stream as before.Persistence start logging gains
mode=local reason=no_flags. The RDB dictionary guide documents the new reason and the Enterpriserequire_persistence_flags()path.Reviewed by Cursor Bugbot for commit a52aa55. Bugbot is set up for automated code reviews on this repo. Configure here.