Skip to content

Conversation

@zuiderkwast
Copy link
Contributor

@zuiderkwast zuiderkwast commented Aug 25, 2025

In #1604, we attempt to read future Valkey RDB formats, but we rejected foreign RDB formats, because of the risk that the opcodes and types added by other projects collide with the new types and opcodes added in recent Valkey versions.

This change accepts foreign RDB versions but limits the types and opcodes to the ones that we can understand, to prevent misinterpretation of types/opcodes which could lead to undefined behavior. If unsupported RDB types or opcodes are seen, we error out.

Additional changes:

  • Improve error reporting when encountering unknown RDB types in relaxed version check mode.
  • Tests for loading various RDB files.
  • Improvement to valkey-check-rdb to accept future and foreign RDB versions, including tests.

@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.22%. Comparing base (9aeab8c) to head (d0922ac).
⚠️ Report is 21 commits behind head on unstable.

Files with missing lines Patch % Lines
src/rdb.c 60.86% 9 Missing ⚠️
src/valkey-check-rdb.c 78.26% 5 Missing ⚠️
src/cluster.c 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #2543   +/-   ##
=========================================
  Coverage     72.21%   72.22%           
=========================================
  Files           126      127    +1     
  Lines         70618    70713   +95     
=========================================
+ Hits          50997    51070   +73     
- Misses        19621    19643   +22     
Files with missing lines Coverage Δ
src/rdb.h 100.00% <100.00%> (ø)
src/cluster.c 89.98% <66.66%> (-0.40%) ⬇️
src/valkey-check-rdb.c 72.55% <78.26%> (+0.44%) ⬆️
src/rdb.c 76.59% <60.86%> (-0.24%) ⬇️

... and 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Viktor Söderqvist <[email protected]>
Copy link
Member

@ranshid ranshid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - small comment about message

@zuiderkwast zuiderkwast added release-notes This issue should get a line item in the release notes major-decision-approved Major decision approved by TSC team needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open. labels Aug 25, 2025
Signed-off-by: Viktor Söderqvist <[email protected]>
Copy link
Collaborator

@hpatro hpatro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. Will be good to have coverage via adding foreign RDB version/type not supported. Might need to start a Redis server and take some snapshots and copy it our test assets.

Signed-off-by: Viktor Söderqvist <[email protected]>
@zuiderkwast zuiderkwast moved this to In Progress in Valkey 9.0 Sep 2, 2025
@zuiderkwast
Copy link
Contributor Author

Mostly LGTM. Will be good to have coverage via adding foreign RDB version/type not supported. Might need to start a Redis server and take some snapshots and copy it our test assets.

@hpatro I have added various RDB files and tests. I created an RDB 12 with the commit just before #665. We actually had RDB 12 in valkey unstable before that PR was merged.

The other files RDB 75 and RDB 987 with and without unknonw types were created by editing the binary files. The unknown type is just a string where I changed the type byte.

Copy link
Member

@ranshid ranshid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.
left some minor comments to consider

Signed-off-by: Viktor Söderqvist <[email protected]>
@zuiderkwast zuiderkwast merged commit 9d10abf into valkey-io:unstable Sep 4, 2025
52 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Valkey 9.0 Sep 4, 2025
@zuiderkwast zuiderkwast deleted the relaxed-rdb-redis branch September 4, 2025 15:19
rjd15372 pushed a commit to rjd15372/valkey that referenced this pull request Sep 19, 2025
In valkey-io#1604, we attempt to read future Valkey RDB formats, but we rejected
foreign RDB formats, because of the risk that the opcodes and types
added by other projects collide with the new types and opcodes added in
recent Valkey versions.

This change accepts foreign RDB versions but limits the types and
opcodes to the ones that we can understand, to prevent misinterpretation
of types/opcodes which could lead to undefined behavior. If unsupported
RDB types or opcodes are seen, we error out.

Additional changes:

* Improve error reporting when encountering unknown RDB types in relaxed
version check mode.
* Tests for loading various RDB files.
* Improvement to valkey-check-rdb to accept future and foreign RDB
versions, including tests.

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
rjd15372 pushed a commit that referenced this pull request Sep 23, 2025
In #1604, we attempt to read future Valkey RDB formats, but we rejected
foreign RDB formats, because of the risk that the opcodes and types
added by other projects collide with the new types and opcodes added in
recent Valkey versions.

This change accepts foreign RDB versions but limits the types and
opcodes to the ones that we can understand, to prevent misinterpretation
of types/opcodes which could lead to undefined behavior. If unsupported
RDB types or opcodes are seen, we error out.

Additional changes:

* Improve error reporting when encountering unknown RDB types in relaxed
version check mode.
* Tests for loading various RDB files.
* Improvement to valkey-check-rdb to accept future and foreign RDB
versions, including tests.

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
hpatro pushed a commit to hpatro/valkey that referenced this pull request Oct 3, 2025
In valkey-io#1604, we attempt to read future Valkey RDB formats, but we rejected
foreign RDB formats, because of the risk that the opcodes and types
added by other projects collide with the new types and opcodes added in
recent Valkey versions.

This change accepts foreign RDB versions but limits the types and
opcodes to the ones that we can understand, to prevent misinterpretation
of types/opcodes which could lead to undefined behavior. If unsupported
RDB types or opcodes are seen, we error out.

Additional changes:

* Improve error reporting when encountering unknown RDB types in relaxed
version check mode.
* Tests for loading various RDB files.
* Improvement to valkey-check-rdb to accept future and foreign RDB
versions, including tests.

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
Signed-off-by: Harkrishn Patro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major-decision-approved Major decision approved by TSC team needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open. release-notes This issue should get a line item in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants