• antirez's avatar
    CLUSTER RESET implemented. · 796f4ae9
    antirez authored
    The new command is able to reset a cluster node so that it starts again
    as a fresh node. By default the command performs a soft reset (the same
    as calling it as CLUSTER RESET SOFT), and the following steps are
    performed:
    
    1) All slots are set as unassigned.
    2) The list of known nodes is flushed.
    3) Node is set as master if it is a slave.
    
    When an hard reset is performed with CLUSTER RESET HARD the following
    additional operations are performed:
    
    4) A new Node ID is created at random.
    5) Epochs are set to 0.
    
    CLUSTER RESET is useful both when the sysadmin wants to reconfigure a
    node with a different role (for example turning a slave into a master)
    and for testing purposes.
    
    It also may play a role in automatically provisioned Redis Clusters,
    since it allows to reset a node back to the initial state in order to be
    reconfigured.
    796f4ae9
cluster.c 170 KB