Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
redis
提交
8f18345e
R
redis
项目概览
别团等shy哥发育
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8f18345e
编写于
11月 29, 2013
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cluster: basic data structures for nodes black list.
上级
3db825fd
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
16 addition
and
0 deletion
+16
-0
src/cluster.c
src/cluster.c
+2
-0
src/cluster.h
src/cluster.h
+1
-0
src/redis.c
src/redis.c
+12
-0
src/redis.h
src/redis.h
+1
-0
未找到文件。
src/cluster.c
浏览文件 @
8f18345e
...
@@ -260,6 +260,8 @@ void clusterInit(void) {
...
@@ -260,6 +260,8 @@ void clusterInit(void) {
server
.
cluster
->
state
=
REDIS_CLUSTER_FAIL
;
server
.
cluster
->
state
=
REDIS_CLUSTER_FAIL
;
server
.
cluster
->
size
=
1
;
server
.
cluster
->
size
=
1
;
server
.
cluster
->
nodes
=
dictCreate
(
&
clusterNodesDictType
,
NULL
);
server
.
cluster
->
nodes
=
dictCreate
(
&
clusterNodesDictType
,
NULL
);
server
.
cluster
->
nodes_black_list
=
dictCreate
(
&
clusterNodesBlackListDictType
,
NULL
);
server
.
cluster
->
failover_auth_time
=
0
;
server
.
cluster
->
failover_auth_time
=
0
;
server
.
cluster
->
failover_auth_count
=
0
;
server
.
cluster
->
failover_auth_count
=
0
;
server
.
cluster
->
failover_auth_epoch
=
0
;
server
.
cluster
->
failover_auth_epoch
=
0
;
...
...
src/cluster.h
浏览文件 @
8f18345e
...
@@ -78,6 +78,7 @@ typedef struct clusterState {
...
@@ -78,6 +78,7 @@ typedef struct clusterState {
int
state
;
/* REDIS_CLUSTER_OK, REDIS_CLUSTER_FAIL, ... */
int
state
;
/* REDIS_CLUSTER_OK, REDIS_CLUSTER_FAIL, ... */
int
size
;
/* Num of master nodes with at least one slot */
int
size
;
/* Num of master nodes with at least one slot */
dict
*
nodes
;
/* Hash table of name -> clusterNode structures */
dict
*
nodes
;
/* Hash table of name -> clusterNode structures */
dict
*
nodes_black_list
;
/* Nodes we don't re-add for a few seconds. */
clusterNode
*
migrating_slots_to
[
REDIS_CLUSTER_SLOTS
];
clusterNode
*
migrating_slots_to
[
REDIS_CLUSTER_SLOTS
];
clusterNode
*
importing_slots_from
[
REDIS_CLUSTER_SLOTS
];
clusterNode
*
importing_slots_from
[
REDIS_CLUSTER_SLOTS
];
clusterNode
*
slots
[
REDIS_CLUSTER_SLOTS
];
clusterNode
*
slots
[
REDIS_CLUSTER_SLOTS
];
...
...
src/redis.c
浏览文件 @
8f18345e
...
@@ -583,6 +583,18 @@ dictType clusterNodesDictType = {
...
@@ -583,6 +583,18 @@ dictType clusterNodesDictType = {
NULL
/* val destructor */
NULL
/* val destructor */
};
};
/* Cluster re-addition blacklist. This maps node IDs to the time
* we can re-add this node. The goal is to avoid readding a removed
* node for some time. */
dictType
clusterNodesBlackListDictType
=
{
dictSdsCaseHash
,
/* hash function */
NULL
,
/* key dup */
NULL
,
/* val dup */
dictSdsKeyCaseCompare
,
/* key compare */
dictSdsDestructor
,
/* key destructor */
NULL
/* val destructor */
};
/* Migrate cache dict type. */
/* Migrate cache dict type. */
dictType
migrateCacheDictType
=
{
dictType
migrateCacheDictType
=
{
dictSdsHash
,
/* hash function */
dictSdsHash
,
/* hash function */
...
...
src/redis.h
浏览文件 @
8f18345e
...
@@ -884,6 +884,7 @@ extern struct sharedObjectsStruct shared;
...
@@ -884,6 +884,7 @@ extern struct sharedObjectsStruct shared;
extern
dictType
setDictType
;
extern
dictType
setDictType
;
extern
dictType
zsetDictType
;
extern
dictType
zsetDictType
;
extern
dictType
clusterNodesDictType
;
extern
dictType
clusterNodesDictType
;
extern
dictType
clusterNodesBlackListDictType
;
extern
dictType
dbDictType
;
extern
dictType
dbDictType
;
extern
dictType
shaScriptObjectDictType
;
extern
dictType
shaScriptObjectDictType
;
extern
double
R_Zero
,
R_PosInf
,
R_NegInf
,
R_Nan
;
extern
double
R_Zero
,
R_PosInf
,
R_NegInf
,
R_Nan
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录