Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
d06fbbdd
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 搜索 >>
提交
d06fbbdd
编写于
11月 30, 2017
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Regression test: Slave restart with EVALSHA in backlog issue #4483.
上级
ab3d3aca
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
1 deletion
+64
-1
tests/integration/psync2.tcl
tests/integration/psync2.tcl
+64
-1
未找到文件。
tests/integration/psync2.tcl
浏览文件 @
d06fbbdd
...
...
@@ -10,7 +10,7 @@ start_server {} {
# Config
set debug_msg 0
;
# Enable additional debug messages
set no_exit 0
;
;
# Do not exit at end of the test
set no_exit 0
;
# Do not exit at end of the test
set duration 20
;
# Total test seconds
...
...
@@ -175,6 +175,69 @@ start_server {} {
assert
{
$sync
_count == $new_sync_count
}
}
test
"PSYNC2: Slave RDB restart with EVALSHA in backlog issue #4483"
{
# Pick a random slave
set slave_id
[
expr
{(
$master
_id+1
)
%5
}]
set sync_count
[
status $R
(
$master
_id
)
sync_full
]
# Make sure to replicate the first EVAL while the salve is online
# so that it's part of the scripts the master believes it's safe
# to propagate as EVALSHA.
$R
(
$master
_id
)
EVAL
{
return redis.call
(
"incr"
,
"__mycounter"
)}
0
$R
(
$master
_id
)
EVALSHA e6e0b547500efcec21eddb619ac3724081afee89 0
# Wait for the two to sync
wait_for_condition 50 1000
{
[
$R
(
$master
_id
)
debug digest
]
==
[
$R
(
$slave
_id
)
debug digest
]
}
else
{
fail
"Slave not reconnecting"
}
# Prevent the slave from receiving master updates, and at
# the same time send a new script several times to the
# master, so that we'll end with EVALSHA into the backlog.
$R
(
$slave
_id
)
slaveof 127.0.0.1 0
$R
(
$master
_id
)
EVALSHA e6e0b547500efcec21eddb619ac3724081afee89 0
$R
(
$master
_id
)
EVALSHA e6e0b547500efcec21eddb619ac3724081afee89 0
$R
(
$master
_id
)
EVALSHA e6e0b547500efcec21eddb619ac3724081afee89 0
catch
{
$R
(
$slave
_id
)
config rewrite
$R
(
$slave
_id
)
debug restart
}
# Reconfigure the slave correctly again, when it's back online.
set retry 50
while
{
$retry
}
{
if
{[
catch
{
$R
(
$slave
_id
)
slaveof $master_host $master_port
}]}
{
after 1000
}
else
{
break
}
incr retry -1
}
# The master should be back at 4 slaves eventually
wait_for_condition 50 1000
{
[
status $R
(
$master
_id
)
connected_slaves
]
== 4
}
else
{
fail
"Slave not reconnecting"
}
set new_sync_count
[
status $R
(
$master
_id
)
sync_full
]
assert
{
$sync
_count == $new_sync_count
}
# However if the slave started with the full state of the
# scripting engine, we should now have the same digest.
wait_for_condition 50 1000
{
[
$R
(
$master
_id
)
debug digest
]
==
[
$R
(
$slave
_id
)
debug digest
]
}
else
{
fail
"Debug digest mismatch between master and slave in post-restart handshake"
}
}
if
{
$no
_exit
}
{
while 1
{
puts -nonewline .
;
flush stdout
;
after 1000
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录