Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
83eb5e7f
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
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,发现更多精彩内容 >>
提交
83eb5e7f
编写于
3月 27, 2015
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test: regression for issue #2473.
上级
96aa6106
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
44 addition
and
8 deletion
+44
-8
tests/integration/replication.tcl
tests/integration/replication.tcl
+44
-8
未找到文件。
tests/integration/replication.tcl
浏览文件 @
83eb5e7f
start_server
{
tags
{
"repl"
}}
{
set A
[
srv 0 client
]
set A_host
[
srv 0 host
]
set A_port
[
srv 0 port
]
start_server
{}
{
test
{
First server should have role slave after SLAVEOF
}
{
r -1 slaveof
[
srv 0 host
]
[
srv 0 port
]
set B
[
srv 0 client
]
set B_host
[
srv 0 host
]
set B_port
[
srv 0 port
]
test
{
Set instance A as slave of B
}
{
$A slaveof $B_host $B_port
wait_for_condition 50 100
{
[
s -1 role
]
eq
{
slave
}
&&
[
string match
{
*master_link_status:up*
}
[
r -1
info replication
]]
[
lindex
[
$A role
]
0
]
eq
{
slave
}
&&
[
string match
{
*master_link_status:up*
}
[
$A
info replication
]]
}
else
{
fail
"Can't turn the instance into a slave"
}
...
...
@@ -15,9 +22,9 @@ start_server {tags {"repl"}} {
$rd brpoplpush a b 5
r lpush a foo
wait_for_condition 50 100
{
[
r debug digest
]
eq
[
r -1
debug digest
]
[
$A debug digest
]
eq
[
$B
debug digest
]
}
else
{
fail
"Master and slave have different digest:
[
r debug digest
]
VS
[
r -1
debug digest
]
"
fail
"Master and slave have different digest:
[
$A debug digest
]
VS
[
$B
debug digest
]
"
}
}
...
...
@@ -28,7 +35,36 @@ start_server {tags {"repl"}} {
r lpush c 3
$rd brpoplpush c d 5
after 1000
assert_equal
[
r debug digest
]
[
r -1 debug digest
]
assert_equal
[
$A debug digest
]
[
$B debug digest
]
}
test
{
BLPOP followed by role change, issue #2473
}
{
set rd
[
redis_deferring_client
]
$rd blpop foo 0
;
# Block while B is a master
# Turn B into master of A
$A slaveof no one
$B slaveof $A_host $A_port
wait_for_condition 50 100
{
[
lindex
[
$B role
]
0
]
eq
{
slave
}
&&
[
string match
{
*master_link_status:up*
}
[
$B info replication
]]
}
else
{
fail
"Can't turn the instance into a slave"
}
# Push elements into the
"foo"
list of the new slave.
# If the client is still attached to the instance, we'll get
# a desync between the two instances.
$A rpush foo a b c
after 100
wait_for_condition 50 100
{
[
$A debug digest
]
eq
[
$B debug digest
]
&&
[
$A lrange foo 0 -1
]
eq
{
a b c
}
&&
[
$B lrange foo 0 -1
]
eq
{
a b c
}
}
else
{
fail
"Master and slave have different digest:
[
$A debug digest
]
VS
[
$B debug digest
]
"
}
}
}
}
...
...
@@ -113,7 +149,7 @@ foreach dl {no yes} {
start_server
{}
{
lappend slaves
[
srv 0 client
]
test
"Connect multiple slaves at the same time (issue #141), diskless=
$dl
"
{
# Send S
AL
VEOF commands to slaves
# Send S
LA
VEOF commands to slaves
[
lindex $slaves 0
]
slaveof $master_host $master_port
[
lindex $slaves 1
]
slaveof $master_host $master_port
[
lindex $slaves 2
]
slaveof $master_host $master_port
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录