Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIGRATE fails for hashes #532

Closed
cababunga opened this issue May 31, 2012 · 3 comments
Closed

MIGRATE fails for hashes #532

cababunga opened this issue May 31, 2012 · 3 comments

Comments

@cababunga
Copy link

Here is what I get running latest version from 2.6 branch:

HSET myhash field1 "Hello"                        
:1
MIGRATE localhost 6379 myhash 0 100
-ERR Target instance replied with error: ERR Bad data format

All other data types seem to be working properly.

@comtaler
Copy link

comtaler commented Jun 1, 2012

This is happening to me as well. Please fix it. It's urgent for me to be able to migrate hash.

@michael-grunder
Copy link
Contributor

Hey guys,

This is happening for ziplist encoded hashses, which are defined as such:

#define REDIS_RDB_TYPE_HASH_ZIPLIST  13

When checking if it's a valid rdb type, it's currently doing this (rdb.h line 57)

#define rdbIsObjectType(t) ((t >= 0 && t <= 4) || (t >= 9 && t <= 12))

Change to this:

#define rdbIsObjectType(t) ((t >= 0 && t <= 4) || (t >= 9 && t <= 13))

And it seems to work. I would submit a pull but it's a tiny change, and also I am literally running out the door. I hope that helps.

Cheers,
Mike

antirez pushed a commit that referenced this issue Jun 2, 2012
(additional commit notes by antirez@gmail.com):

The rdbIsObjectType() macro was not updated when the new RDB object type
of ziplist encoded hashes was added.

As a result RESTORE, that uses rdbLoadObjectType(), failed when a
ziplist encoded hash was loaded.
This does not affected normal RDB loading because in that case we use
the lower-level function rdbLoadType().

The commit also adds a regression test.
antirez pushed a commit that referenced this issue Jun 2, 2012
(additional commit notes by antirez@gmail.com):

The rdbIsObjectType() macro was not updated when the new RDB object type
of ziplist encoded hashes was added.

As a result RESTORE, that uses rdbLoadObjectType(), failed when a
ziplist encoded hash was loaded.
This does not affected normal RDB loading because in that case we use
the lower-level function rdbLoadType().

The commit also adds a regression test.
@antirez
Copy link
Contributor

antirez commented Jun 2, 2012

Fix merged, thanks. Closing the issue.

@antirez antirez closed this as completed Jun 2, 2012
tsee pushed a commit to tsee/redis that referenced this issue Jul 31, 2012
(additional commit notes by antirez@gmail.com):

The rdbIsObjectType() macro was not updated when the new RDB object type
of ziplist encoded hashes was added.

As a result RESTORE, that uses rdbLoadObjectType(), failed when a
ziplist encoded hash was loaded.
This does not affected normal RDB loading because in that case we use
the lower-level function rdbLoadType().

The commit also adds a regression test.
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

No branches or pull requests

4 participants