Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
7f5bdba4
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,发现更多精彩内容 >>
提交
7f5bdba4
编写于
7月 28, 2012
作者:
A
antirez
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/unstable' into unstable
上级
3f194a9d
f3a61431
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
21 addition
and
3 deletion
+21
-3
src/aof.c
src/aof.c
+13
-0
src/redis.c
src/redis.c
+6
-3
src/redis.h
src/redis.h
+1
-0
src/sentinel.c
src/sentinel.c
+1
-0
未找到文件。
src/aof.c
浏览文件 @
7f5bdba4
...
@@ -250,6 +250,13 @@ void flushAppendOnlyFile(int force) {
...
@@ -250,6 +250,13 @@ void flushAppendOnlyFile(int force) {
strerror
(
errno
),
strerror
(
errno
),
(
long
)
nwritten
,
(
long
)
nwritten
,
(
long
)
sdslen
(
server
.
aof_buf
));
(
long
)
sdslen
(
server
.
aof_buf
));
if
(
ftruncate
(
server
.
aof_fd
,
server
.
aof_current_size
)
==
-
1
)
{
redisLog
(
REDIS_WARNING
,
"Could not remove short write "
"from the append-only file. Redis may refuse "
"to load the AOF the next time it starts. "
"ftruncate: %s"
,
strerror
(
errno
));
}
}
}
exit
(
1
);
exit
(
1
);
}
}
...
@@ -1093,6 +1100,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
...
@@ -1093,6 +1100,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
server
.
aof_buf
=
sdsempty
();
server
.
aof_buf
=
sdsempty
();
}
}
server
.
aof_lastbgrewrite_status
=
REDIS_OK
;
redisLog
(
REDIS_NOTICE
,
"Background AOF rewrite finished successfully"
);
redisLog
(
REDIS_NOTICE
,
"Background AOF rewrite finished successfully"
);
/* Change state from WAIT_REWRITE to ON if needed */
/* Change state from WAIT_REWRITE to ON if needed */
if
(
server
.
aof_state
==
REDIS_AOF_WAIT_REWRITE
)
if
(
server
.
aof_state
==
REDIS_AOF_WAIT_REWRITE
)
...
@@ -1104,9 +1113,13 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
...
@@ -1104,9 +1113,13 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
redisLog
(
REDIS_VERBOSE
,
redisLog
(
REDIS_VERBOSE
,
"Background AOF rewrite signal handler took %lldus"
,
ustime
()
-
now
);
"Background AOF rewrite signal handler took %lldus"
,
ustime
()
-
now
);
}
else
if
(
!
bysignal
&&
exitcode
!=
0
)
{
}
else
if
(
!
bysignal
&&
exitcode
!=
0
)
{
server
.
aof_lastbgrewrite_status
=
REDIS_ERR
;
redisLog
(
REDIS_WARNING
,
redisLog
(
REDIS_WARNING
,
"Background AOF rewrite terminated with error"
);
"Background AOF rewrite terminated with error"
);
}
else
{
}
else
{
server
.
aof_lastbgrewrite_status
=
REDIS_ERR
;
redisLog
(
REDIS_WARNING
,
redisLog
(
REDIS_WARNING
,
"Background AOF rewrite terminated by signal %d"
,
bysignal
);
"Background AOF rewrite terminated by signal %d"
,
bysignal
);
}
}
...
...
src/redis.c
浏览文件 @
7f5bdba4
...
@@ -1121,6 +1121,7 @@ void initServerConfig() {
...
@@ -1121,6 +1121,7 @@ void initServerConfig() {
server
.
aof_last_fsync
=
time
(
NULL
);
server
.
aof_last_fsync
=
time
(
NULL
);
server
.
aof_rewrite_time_last
=
-
1
;
server
.
aof_rewrite_time_last
=
-
1
;
server
.
aof_rewrite_time_start
=
-
1
;
server
.
aof_rewrite_time_start
=
-
1
;
server
.
aof_lastbgrewrite_status
=
REDIS_OK
;
server
.
aof_delayed_fsync
=
0
;
server
.
aof_delayed_fsync
=
0
;
server
.
aof_fd
=
-
1
;
server
.
aof_fd
=
-
1
;
server
.
aof_selected_db
=
-
1
;
/* Make sure the first time will not match */
server
.
aof_selected_db
=
-
1
;
/* Make sure the first time will not match */
...
@@ -1967,12 +1968,13 @@ sds genRedisInfoString(char *section) {
...
@@ -1967,12 +1968,13 @@ sds genRedisInfoString(char *section) {
"aof_rewrite_in_progress:%d
\r\n
"
"aof_rewrite_in_progress:%d
\r\n
"
"aof_rewrite_scheduled:%d
\r\n
"
"aof_rewrite_scheduled:%d
\r\n
"
"aof_last_rewrite_time_sec:%ld
\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
.
loading
,
server
.
dirty
,
server
.
dirty
,
server
.
rdb_child_pid
!=
-
1
,
server
.
rdb_child_pid
!=
-
1
,
server
.
lastsave
,
server
.
lastsave
,
server
.
lastbgsave_status
==
REDIS_OK
?
"ok"
:
"err"
,
(
server
.
lastbgsave_status
==
REDIS_OK
)
?
"ok"
:
"err"
,
server
.
rdb_save_time_last
,
server
.
rdb_save_time_last
,
(
server
.
rdb_child_pid
==
-
1
)
?
(
server
.
rdb_child_pid
==
-
1
)
?
-
1
:
time
(
NULL
)
-
server
.
rdb_save_time_start
,
-
1
:
time
(
NULL
)
-
server
.
rdb_save_time_start
,
...
@@ -1981,7 +1983,8 @@ sds genRedisInfoString(char *section) {
...
@@ -1981,7 +1983,8 @@ sds genRedisInfoString(char *section) {
server
.
aof_rewrite_scheduled
,
server
.
aof_rewrite_scheduled
,
server
.
aof_rewrite_time_last
,
server
.
aof_rewrite_time_last
,
(
server
.
aof_child_pid
==
-
1
)
?
(
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
)
{
if
(
server
.
aof_state
!=
REDIS_AOF_OFF
)
{
info
=
sdscatprintf
(
info
,
info
=
sdscatprintf
(
info
,
...
...
src/redis.h
浏览文件 @
7f5bdba4
...
@@ -652,6 +652,7 @@ struct redisServer {
...
@@ -652,6 +652,7 @@ struct redisServer {
time_t
aof_last_fsync
;
/* UNIX time of last fsync() */
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_last
;
/* Time used by last AOF rewrite run. */
time_t
aof_rewrite_time_start
;
/* Current AOF rewrite start time. */
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 */
unsigned
long
aof_delayed_fsync
;
/* delayed AOF fsync() counter */
/* RDB persistence */
/* RDB persistence */
long
long
dirty
;
/* Changes to DB from the last save */
long
long
dirty
;
/* Changes to DB from the last save */
...
...
src/sentinel.c
浏览文件 @
7f5bdba4
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <ctype.h>
#include <ctype.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <sys/wait.h>
extern
char
**
environ
;
extern
char
**
environ
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录