• WuYunlong's avatar
    Speedup cluster failover. (#7948) · 7fa56dd7
    WuYunlong authored
    
    
    This commit deals with manual failover as well as non-manual failover.
    
    We did tests with manual failover as follows:
    1, Setup redis cluster which holds 16 partions, each having only
       1 corresponding replica.
    2, Write a batch of data to redis cluster and make sure the redis is doing
       a active expire in serverCron.
    3, Do a manual failover sequentially to each partions with a time interval
       of 3 minutes.
    4, Collect logs and do some computaiton work.
    
    The result:
    case    avgTime    maxTime    minTime
    C1      95.8ms	   227ms      25ms
    C2      47.9ms     96ms       12ms
    C3      12.6ms     27ms       7ms
    
    Explanation
    case C1: All nodes use the version before optimization
    case C2: Masters use the elder version while replicas use the optimized version
    case C3: All nodes use the optimized version
    failover time: The time between when replica got a `manual failover request` and
                   when it `won the failover election`.
    avgTime: average failover time
    maxTime: maximum failover time
    minTime: mimimum failover time
    ms: millisecond
    Co-authored-by: default avatarchendq8 <c.d_q@163.com>
    7fa56dd7
cluster.h 14 KB