Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
04950a9e
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,发现更多精彩内容 >>
提交
04950a9e
编写于
7月 27, 2012
作者:
S
Salvatore Sanfilippo
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #586 from saj/aof_last_bgrewrite_status
New in INFO: aof_last_bgrewrite_status
上级
a3593ee4
48553a29
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
3 deletion
+13
-3
src/aof.c
src/aof.c
+6
-0
src/redis.c
src/redis.c
+6
-3
src/redis.h
src/redis.h
+1
-0
未找到文件。
src/aof.c
浏览文件 @
04950a9e
...
...
@@ -1093,6 +1093,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
server
.
aof_buf
=
sdsempty
();
}
server
.
aof_lastbgrewrite_status
=
REDIS_OK
;
redisLog
(
REDIS_NOTICE
,
"Background AOF rewrite finished successfully"
);
/* Change state from WAIT_REWRITE to ON if needed */
if
(
server
.
aof_state
==
REDIS_AOF_WAIT_REWRITE
)
...
...
@@ -1104,9 +1106,13 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
redisLog
(
REDIS_VERBOSE
,
"Background AOF rewrite signal handler took %lldus"
,
ustime
()
-
now
);
}
else
if
(
!
bysignal
&&
exitcode
!=
0
)
{
server
.
aof_lastbgrewrite_status
=
REDIS_ERR
;
redisLog
(
REDIS_WARNING
,
"Background AOF rewrite terminated with error"
);
}
else
{
server
.
aof_lastbgrewrite_status
=
REDIS_ERR
;
redisLog
(
REDIS_WARNING
,
"Background AOF rewrite terminated by signal %d"
,
bysignal
);
}
...
...
src/redis.c
浏览文件 @
04950a9e
...
...
@@ -1121,6 +1121,7 @@ void initServerConfig() {
server
.
aof_last_fsync
=
time
(
NULL
);
server
.
aof_rewrite_time_last
=
-
1
;
server
.
aof_rewrite_time_start
=
-
1
;
server
.
aof_lastbgrewrite_status
=
REDIS_OK
;
server
.
aof_delayed_fsync
=
0
;
server
.
aof_fd
=
-
1
;
server
.
aof_selected_db
=
-
1
;
/* Make sure the first time will not match */
...
...
@@ -1967,12 +1968,13 @@ sds genRedisInfoString(char *section) {
"aof_rewrite_in_progress:%d
\r\n
"
"aof_rewrite_scheduled:%d
\r\n
"
"aof_last_rewrite_time_sec:%ld
\r\n
"
"aof_current_rewrite_time_sec:%ld
\r\n
"
,
"aof_current_rewrite_time_sec:%ld
\r\n
"
"aof_last_bgrewrite_status:%s
\r\n
"
,
server
.
loading
,
server
.
dirty
,
server
.
rdb_child_pid
!=
-
1
,
server
.
lastsave
,
server
.
lastbgsave_status
==
REDIS_OK
?
"ok"
:
"err"
,
(
server
.
lastbgsave_status
==
REDIS_OK
)
?
"ok"
:
"err"
,
server
.
rdb_save_time_last
,
(
server
.
rdb_child_pid
==
-
1
)
?
-
1
:
time
(
NULL
)
-
server
.
rdb_save_time_start
,
...
...
@@ -1981,7 +1983,8 @@ sds genRedisInfoString(char *section) {
server
.
aof_rewrite_scheduled
,
server
.
aof_rewrite_time_last
,
(
server
.
aof_child_pid
==
-
1
)
?
-
1
:
time
(
NULL
)
-
server
.
aof_rewrite_time_start
);
-
1
:
time
(
NULL
)
-
server
.
aof_rewrite_time_start
,
(
server
.
aof_lastbgrewrite_status
==
REDIS_OK
)
?
"ok"
:
"err"
);
if
(
server
.
aof_state
!=
REDIS_AOF_OFF
)
{
info
=
sdscatprintf
(
info
,
...
...
src/redis.h
浏览文件 @
04950a9e
...
...
@@ -652,6 +652,7 @@ struct redisServer {
time_t
aof_last_fsync
;
/* UNIX time of last fsync() */
time_t
aof_rewrite_time_last
;
/* Time used by last AOF rewrite run. */
time_t
aof_rewrite_time_start
;
/* Current AOF rewrite start time. */
int
aof_lastbgrewrite_status
;
/* REDIS_OK or REDIS_ERR */
unsigned
long
aof_delayed_fsync
;
/* delayed AOF fsync() counter */
/* RDB persistence */
long
long
dirty
;
/* Changes to DB from the last save */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录