• Huang Zhw's avatar
    When redis-cli received ASK, it didn't handle it (#8930) · 8892b5cf
    Huang Zhw authored
    
    
    When redis-cli received ASK, it used string matching wrong and didn't
    handle it.
    
    When we access a slot which is in migrating state, it maybe
    return ASK. After redirect to the new node, we need send ASKING
    command before retry the command.  In this PR after redis-cli receives
    ASK, we send a ASKING command before send the origin command
    after reconnecting.
    
    Other changes:
    * Make redis-cli -u and -c (unix socket and cluster mode) incompatible
      with one another.
    * When send command fails, we avoid the 2nd reconnect retry and just
      print the error info. Users will decide how to do next.
      See #9277.
    * Add a test faking two redis nodes in TCL to just send ASK and OK in
      redis protocol to test ASK behavior.
    Co-authored-by: default avatarViktor Söderqvist <viktor.soderqvist@est.tech>
    Co-authored-by: default avatarOran Agra <oran@redislabs.com>
    (cherry picked from commit cf61ad14)
    8892b5cf
redis-cli.c 311 KB