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
7c283c52
Commit
7c283c52
authored
Jan 09, 2015
by
antirez
Browse files
Cluster test: also write from Lua script in resharding test.
parent
6f3553a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/cluster/tests/04-resharding.tcl
View file @
7c283c52
...
...
@@ -66,9 +66,18 @@ test "Cluster consistency during live resharding" {
}
# Write random data to random list.
set key
"key:
[
randomInt $numkeys
]
"
set listid
[
randomInt $numkeys
]
set key
"key:
$listid
"
set ele
[
randomValue
]
$cluster rpush $key $ele
# We write both with Lua scripts and with plain commands.
# This way we are able to stress Lua -> Redis command invocation
# as well, that has tests to prevent Lua to write into wrong
# hash slots.
if
{
$listid
% 2
}
{
$cluster rpush $key $ele
}
else
{
$cluster eval
{
redis.call
(
"rpush"
,KEYS
[
1
]
,ARGV
[
1
])}
1 $key $ele
}
lappend content
(
$key
)
$ele
if
{(
$j
% 1000
)
== 0
}
{
...
...
tests/support/cluster.tcl
View file @
7c283c52
...
...
@@ -226,6 +226,8 @@ proc ::redis_cluster::get_keys_from_command {cmd argv} {
# Special handling for other commands
switch -exact $cmd
{
mget
{
return $argv
}
eval
{
return
[
lrange $argv 2 1+
[
lindex $argv 1
]]}
evalsha
{
return
[
lrange $argv 2 1+
[
lindex $argv 1
]]}
}
# All the remaining commands are not handled.
...
...
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