Skip to content

redis-trib fix: handle target key existing #2770

@antirez

Description

@antirez

If the connection breaks in the middle of a resharding operation, MIGRATE may end not deleting the key from the source node, while the target node key was already materialized.

This will later result in redis-trib fix not being able to handle the condition, with an error like that:

*** Target key my_key exists. Replace it for FIX.

This should be fixed with one of the following solutions.

  1. Always use MIGRATE REPLACE.
  2. Don't overwrite existing keys and rename one of the two, outputting the key name, so the database is usable and no data is lost, and the sysadmin can check what happened.
  3. Possibly... modify DEBUG DIGEST to be able to take a single key so that we can check if the two keys are the same (very likely most of the times) and silently do the right thing.
  4. Some other solution... but asking the user is probably not wise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions