Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
e6f287d5
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,体验更适合开发者的 AI 搜索 >>
提交
e6f287d5
编写于
8月 02, 2018
作者:
Z
zhaozhao.zz
提交者:
antirez
10月 10, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
AOF: discard if we lost EXEC when loading aof
上级
e0d4c66a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
3 deletion
+14
-3
src/aof.c
src/aof.c
+13
-2
src/multi.c
src/multi.c
+1
-1
未找到文件。
src/aof.c
浏览文件 @
e6f287d5
...
...
@@ -677,6 +677,7 @@ int loadAppendOnlyFile(char *filename) {
int
old_aof_state
=
server
.
aof_state
;
long
loops
=
0
;
off_t
valid_up_to
=
0
;
/* Offset of latest well-formed command loaded. */
off_t
valid_before_multi
=
0
;
/* Offset before MULTI command loaded. */
if
(
fp
==
NULL
)
{
serverLog
(
LL_WARNING
,
"Fatal error: can't open the append log file for reading: %s"
,
strerror
(
errno
));
...
...
@@ -781,9 +782,15 @@ int loadAppendOnlyFile(char *filename) {
exit
(
1
);
}
if
(
cmd
==
server
.
multiCommand
)
valid_before_multi
=
valid_up_to
;
/* Run the command in the context of a fake client */
fakeClient
->
cmd
=
cmd
;
cmd
->
proc
(
fakeClient
);
if
(
fakeClient
->
flags
&
CLIENT_MULTI
&&
fakeClient
->
cmd
->
proc
!=
execCommand
)
{
queueMultiCommand
(
fakeClient
);
}
else
{
cmd
->
proc
(
fakeClient
);
}
/* The fake client should not have a reply */
serverAssert
(
fakeClient
->
bufpos
==
0
&&
listLength
(
fakeClient
->
reply
)
==
0
);
...
...
@@ -801,7 +808,11 @@ int loadAppendOnlyFile(char *filename) {
* If the client is in the middle of a MULTI/EXEC, handle it as it was
* a short read, even if technically the protocol is correct: we want
* to remove the unprocessed tail and continue. */
if
(
fakeClient
->
flags
&
CLIENT_MULTI
)
goto
uxeof
;
if
(
fakeClient
->
flags
&
CLIENT_MULTI
)
{
serverLog
(
LL_WARNING
,
"!!! Warning: we lost EXEC in the middle of transaction, discard !!!"
);
valid_up_to
=
valid_before_multi
;
goto
uxeof
;
}
loaded_ok:
/* DB loaded, cleanup and return C_OK to the caller. */
fclose
(
fp
);
...
...
src/multi.c
浏览文件 @
e6f287d5
...
...
@@ -158,7 +158,7 @@ void execCommand(client *c) {
must_propagate
=
1
;
}
call
(
c
,
CMD_CALL_FULL
);
call
(
c
,
server
.
loading
?
CMD_CALL_NONE
:
CMD_CALL_FULL
);
/* Commands may alter argc/argv, restore mstate. */
c
->
mstate
.
commands
[
j
].
argc
=
c
->
argc
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录