• antirez's avatar
    PSYNC2: meaningful offset implemented. · 57fa355e
    antirez authored
    A very commonly signaled operational problem with Redis master-replicas
    sets is that, once the master becomes unavailable for some reason,
    especially because of network problems, many times it wont be able to
    perform a partial resynchronization with the new master, once it rejoins
    the partition, for the following reason:
    
    1. The master becomes isolated, however it keeps sending PINGs to the
    replicas. Such PINGs will never be received since the link connection is
    actually already severed.
    2. On the other side, one of the replicas will turn into the new master,
    setting its secondary replication ID offset to the one of the last
    command received from the old master: this offset will not include the
    PINGs sent by the master once the link was already disconnected.
    3. When the master rejoins the partion and is turned into a replica, its
    offset will be too advanced because of the PINGs, so a PSYNC will fail,
    and a full synchronization will be required.
    
    Related to issue #7002 and other discussion we had in the past around
    this problem.
    57fa355e
replication.c 134 KB