Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
5f8360eb
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
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,发现更多精彩内容 >>
提交
5f8360eb
编写于
10月 16, 2014
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Diskless replication flag renamed repl_diskless -> repl_diskless_sync.
上级
e9e00755
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
src/redis.c
src/redis.c
+1
-1
src/redis.h
src/redis.h
+3
-3
src/replication.c
src/replication.c
+5
-5
未找到文件。
src/redis.c
浏览文件 @
5f8360eb
...
...
@@ -1480,7 +1480,7 @@ void initServerConfig(void) {
server
.
repl_slave_ro
=
REDIS_DEFAULT_SLAVE_READ_ONLY
;
server
.
repl_down_since
=
0
;
/* Never connected, repl is down since EVER. */
server
.
repl_disable_tcp_nodelay
=
REDIS_DEFAULT_REPL_DISABLE_TCP_NODELAY
;
server
.
repl_diskless
=
REDIS_DEFAULT_RDB_DISKLESS
;
server
.
repl_diskless
_sync
=
REDIS_DEFAULT_RDB_DISKLESS_SYNC
;
server
.
slave_priority
=
REDIS_DEFAULT_SLAVE_PRIORITY
;
server
.
master_repl_offset
=
0
;
...
...
src/redis.h
浏览文件 @
5f8360eb
...
...
@@ -114,8 +114,8 @@ typedef long long mstime_t; /* millisecond time type. */
#define REDIS_DEFAULT_RDB_COMPRESSION 1
#define REDIS_DEFAULT_RDB_CHECKSUM 1
#define REDIS_DEFAULT_RDB_FILENAME "dump.rdb"
#define REDIS_DEFAULT_RDB_DISKLESS 0
#define REDIS_DEFAULT_RDB_DISKLESS_DELAY 5
#define REDIS_DEFAULT_RDB_DISKLESS
_SYNC
0
#define REDIS_DEFAULT_RDB_DISKLESS_
SYNC_
DELAY 5
#define REDIS_DEFAULT_SLAVE_SERVE_STALE_DATA 1
#define REDIS_DEFAULT_SLAVE_READ_ONLY 1
#define REDIS_DEFAULT_REPL_DISABLE_TCP_NODELAY 0
...
...
@@ -801,7 +801,7 @@ struct redisServer {
int
repl_min_slaves_to_write
;
/* Min number of slaves to write. */
int
repl_min_slaves_max_lag
;
/* Max lag of <count> slaves to write. */
int
repl_good_slaves_count
;
/* Number of slaves with lag <= max_lag. */
int
repl_diskless
;
/* Send RDB to slaves sockets directly. */
int
repl_diskless
_sync
;
/* Send RDB to slaves sockets directly. */
/* Replication (slave) */
char
*
masterauth
;
/* AUTH with this password with master */
char
*
masterhost
;
/* Hostname of master */
...
...
src/replication.c
浏览文件 @
5f8360eb
...
...
@@ -417,9 +417,9 @@ int startBgsaveForReplication(void) {
int
retval
;
redisLog
(
REDIS_NOTICE
,
"Starting BGSAVE for SYNC with target: %s"
,
server
.
repl_diskless
?
"slaves sockets"
:
"disk"
);
server
.
repl_diskless
_sync
?
"slaves sockets"
:
"disk"
);
if
(
server
.
repl_diskless
)
if
(
server
.
repl_diskless
_sync
)
retval
=
rdbSaveToSlavesSockets
();
else
retval
=
rdbSaveBackground
(
server
.
rdb_filename
);
...
...
@@ -523,7 +523,7 @@ void syncCommand(redisClient *c) {
c
->
replstate
=
REDIS_REPL_WAIT_BGSAVE_START
;
redisLog
(
REDIS_NOTICE
,
"Waiting for next BGSAVE for SYNC"
);
}
else
{
if
(
server
.
repl_diskless
)
{
if
(
server
.
repl_diskless
_sync
)
{
/* Diskless replication RDB child is created inside
* replicationCron() since we want to delay its start a
* few seconds to wait for more slaves to arrive. */
...
...
@@ -1944,7 +1944,7 @@ void replicationCron(void) {
/* If we are using diskless replication and there are slaves waiting
* in WAIT_BGSAVE_START state, check if enough seconds elapsed and
* start one. */
if
(
server
.
repl_diskless
&&
server
.
rdb_child_pid
==
-
1
&&
if
(
server
.
repl_diskless
_sync
&&
server
.
rdb_child_pid
==
-
1
&&
server
.
aof_child_pid
==
-
1
)
{
time_t
idle
,
max_idle
=
0
;
...
...
@@ -1962,7 +1962,7 @@ void replicationCron(void) {
}
}
if
(
slaves_waiting
&&
max_idle
>
REDIS_DEFAULT_RDB_DISKLESS_DELAY
)
{
if
(
slaves_waiting
&&
max_idle
>
REDIS_DEFAULT_RDB_DISKLESS_
SYNC_
DELAY
)
{
/* Let's start a BGSAVE with disk target. */
if
(
startBgsaveForReplication
()
==
REDIS_OK
)
{
/* It started! We need to change the state of slaves
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录