Skip to content

Internal error in RDB reading function at rdb.c:1546 -> Duplicate keys detected #6379

@Venorcis

Description

@Venorcis

We were surprised today with the error in the title when trying to sync a new replica to its master. Upon this error, the whole replica even crashed (which I don't think is appropriate handling of this issue).

The exact same error appeared when running redis-check-rdb on the master's RDB file, only luckily in that output there was some additional info, i.e. the key of the database entry that caused the error and the fact that it happened whilst 'reading type 4 (hash-hashtable)'.

It turned out that for some unknown reason (IMO a Redis bug), indeed a key existed twice in a hash, as visible in this image:
image

Running 'HDEL key "key"' removed the first entry (with value "msg.save", the correct entry) and luckily allowed our sync to work again. However, under no circumstances can I now delete or edit the second entry; only in an 'HGETALL key' does it show up (i.e. HDEL and/or HGET do not work; HSET actually creates a new entry with key "key").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions