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
d5f1e4b0
Commit
d5f1e4b0
authored
Jun 25, 2013
by
antirez
Browse files
Test: add some AOF testing to EVALSHA replication test.
parent
73d7955c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/replication-3.tcl
View file @
d5f1e4b0
...
...
@@ -46,6 +46,10 @@ start_server {tags {"repl"}} {
set numops 20000
;
# Enough to trigger the Script Cache LRU eviction.
# While we are at it, enable AOF to test it will be consistent as well
# after the test.
r config set appendonly yes
test
{
MASTER and SLAVE consistency with EVALSHA replication
}
{
array set oldsha
{}
for
{
set j 0
}
{
$j
< $numops
}
{
incr j
}
{
...
...
@@ -60,6 +64,13 @@ start_server {tags {"repl"}} {
# Additionally call one of the old scripts as well, at random.
set res
[
r evalsha $oldsha
([
randomInt $j
])
0
]
assert
{
$res
> 2
}
# Trigger an AOF rewrite while we are half-way, this also
# forces the flush of the script cache, and we will cover
# more code as a result.
if
{
$j
== $numops / 2
}
{
catch
{
r bgrewriteaof
}
}
}
wait_for_condition 50 100
{
...
...
@@ -79,6 +90,12 @@ start_server {tags {"repl"}} {
puts
"Run diff -u against /tmp/repldump*.txt for more info"
}
set old_digest
[
r debug digest
]
r config set appendonly no
r debug loadaof
set new_digest
[
r debug digest
]
assert
{
$old
_digest eq $new_digest
}
}
}
}
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