summaryrefslogtreecommitdiff
path: root/src/cluster.h
diff options
context:
space:
mode:
authorWuYunlong <xzsyeb@126.com>2020-10-27 14:13:59 +0800
committerGitHub <noreply@github.com>2020-10-27 08:13:59 +0200
commit7fa56dd773cac7155f7a7768458b1f59d1f39a13 (patch)
treeb3b131da976f3f3f6d89567a23c78ad7fd6bc5a5 /src/cluster.h
parentdac26729a9259754eda0403cd32f011a3d2a89e1 (diff)
downloadredis-7fa56dd773cac7155f7a7768458b1f59d1f39a13.tar.gz
Speedup cluster failover. (#7948)
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: chendq8 <c.d_q@163.com>
Diffstat (limited to 'src/cluster.h')
-rw-r--r--src/cluster.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cluster.h b/src/cluster.h
index 48a111764..95b710383 100644
--- a/src/cluster.h
+++ b/src/cluster.h
@@ -77,6 +77,7 @@ typedef struct clusterLink {
#define CLUSTER_TODO_UPDATE_STATE (1<<1)
#define CLUSTER_TODO_SAVE_CONFIG (1<<2)
#define CLUSTER_TODO_FSYNC_CONFIG (1<<3)
+#define CLUSTER_TODO_HANDLE_MANUALFAILOVER (1<<4)
/* Message types.
*