Skip to content

Conversation

@git-hulk
Copy link
Member

Currently, we're using the maximum RDB version(12) when dumping the payload which is not allowed in the old Redis versions(before Redis 7), so it will throw the error:

127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x0c\x00\x83\x94g!\xfaP\xf9\xf0"
(error) ERR DUMP payload version or checksum are wrong

This PR changes the payload's RDB version to 6 to make it work with the old Redis versions. And after applying this PR, it works well in Redis 4/6:

127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x06\x00\xde\x0f;a\xf5/[*"
OK
127.0.0.1:6379> get a
"123"

127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x06\x00\xde\x0f;a\xf5/[*"
OK
127.0.0.1:6379> get a
"123"

Fixes #2251

…yload

Currently, we're using the maximum RDB version(12) when dumping the payload
which is not allowed in the old Redis versions(before Redis 7), so it
will throw the error:

```
127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x0c\x00\x83\x94g!\xfaP\xf9\xf0"
(error) ERR DUMP payload version or checksum are wrong
```

This PR changes the payload's RDB version to 6 for making it works with
the old Redis versions. And after applying this PR, it works well in
Redis 4/6:

```
127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x06\x00\xde\x0f;a\xf5/[*"
OK
127.0.0.1:6379> get a
"123"

127.0.0.1:6379> RESTORE a 0 "\x00\xc0{\x06\x00\xde\x0f;a\xf5/[*"
OK
127.0.0.1:6379> get a
"123"
```
@sonarqubecloud
Copy link

@git-hulk git-hulk merged commit 4ecb35b into apache:unstable Apr 16, 2024
@git-hulk git-hulk mentioned this pull request Apr 22, 2024
2 tasks
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.

"DUMP" command produces content not compatible with Redis

3 participants