Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d1ff3281
Commit
d1ff3281
authored
Aug 04, 2015
by
antirez
Browse files
Test PSYNC with diskless replication.
Thanks to Oran Agra from Redis Labs for providing this patch.
parent
6233d210
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/replication-psync.tcl
View file @
d1ff3281
...
@@ -13,7 +13,7 @@ proc stop_bg_complex_data {handle} {
...
@@ -13,7 +13,7 @@ proc stop_bg_complex_data {handle} {
#
#
# You can specifiy backlog size, ttl, delay before reconnection, test duration
# You can specifiy backlog size, ttl, delay before reconnection, test duration
# in seconds, and an additional condition to verify at the end.
# in seconds, and an additional condition to verify at the end.
proc test_psync
{
descr duration backlog_size backlog_ttl delay cond
}
{
proc test_psync
{
descr duration backlog_size backlog_ttl delay cond
diskless
}
{
start_server
{
tags
{
"repl"
}}
{
start_server
{
tags
{
"repl"
}}
{
start_server
{}
{
start_server
{}
{
...
@@ -24,6 +24,8 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
...
@@ -24,6 +24,8 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
$master config set repl-backlog-size $backlog_size
$master config set repl-backlog-size $backlog_size
$master config set repl-backlog-ttl $backlog_ttl
$master config set repl-backlog-ttl $backlog_ttl
$master config set repl-diskless-sync $diskless
$master config set repl-diskless-sync-delay 1
set load_handle0
[
start_bg_complex_data $master_host $master_port 9 100000
]
set load_handle0
[
start_bg_complex_data $master_host $master_port 9 100000
]
set load_handle1
[
start_bg_complex_data $master_host $master_port 11 100000
]
set load_handle1
[
start_bg_complex_data $master_host $master_port 11 100000
]
...
@@ -48,7 +50,7 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
...
@@ -48,7 +50,7 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
}
}
}
}
test
"Test replication partial resync:
$descr
"
{
test
"Test replication partial resync:
$descr
(diskless:
$diskless
)
"
{
# Now while the clients are writing data, break the maste-slave
# Now while the clients are writing data, break the maste-slave
# link multiple times.
# link multiple times.
for
{
set j 0
}
{
$j
< $duration*10
}
{
incr j
}
{
for
{
set j 0
}
{
$j
< $duration*10
}
{
incr j
}
{
...
@@ -98,18 +100,20 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
...
@@ -98,18 +100,20 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
}
}
}
}
test_psync
{
ok psync
}
6 1000000 3600 0
{
foreach diskless
{
no yes
}
{
assert
{[
s -1 sync_partial_ok
]
> 0
}
test_psync
{
ok psync
}
6 1000000 3600 0
{
}
assert
{[
s -1 sync_partial_ok
]
> 0
}
}
$diskless
test_psync
{
no backlog
}
6 100 3600 0.5
{
test_psync
{
no backlog
}
6 100 3600 0.5
{
assert
{[
s -1 sync_partial_err
]
> 0
}
assert
{[
s -1 sync_partial_err
]
> 0
}
}
}
$diskless
test_psync
{
ok after delay
}
3 100000000 3600 3
{
test_psync
{
ok after delay
}
3 100000000 3600 3
{
assert
{[
s -1 sync_partial_ok
]
> 0
}
assert
{[
s -1 sync_partial_ok
]
> 0
}
}
}
$diskless
test_psync
{
backlog expired
}
3 100000000 1 3
{
test_psync
{
backlog expired
}
3 100000000 1 3
{
assert
{[
s -1 sync_partial_err
]
> 0
}
assert
{[
s -1 sync_partial_err
]
> 0
}
}
$diskless
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment