• Makdon's avatar
    redis-cli: use previous hostip when not provided by redis cluster server (#12273) · 2495b90a
    Makdon authored
    
    
    When the redis server cluster running on cluster-preferred-endpoint-type unknown-endpoint mode, and receive a request that should be redirected to another redis server node, it does not reply the hostip, but a empty host like MOVED 3999 :6381.
    
    The redis-cli would try to connect to an address without a host, which cause the issue:
    ```
    127.0.0.1:7002> set bar bar
    -> Redirected to slot [5061] located at :7000
    Could not connect to Redis at :7000: No address associated with hostname
    Could not connect to Redis at :7000: No address associated with hostname
    not connected> exit
    ```
    
    In this case, the redis-cli should use the previous hostip when there's no host provided by the server.
    
    ---------
    Co-authored-by: default avatarViktor Söderqvist <viktor.soderqvist@est.tech>
    Co-authored-by: default avatarMadelyn Olson <madelynolson@gmail.com>
    2495b90a
redis-cli.c 371 KB