mirror of
https://github.com/fluencelabs/redis
synced 2025-05-03 14:32:14 +00:00
Test: test replication of MULTI/EXEC.
This commit is contained in:
parent
61b1d6da18
commit
c6a9a20d3b
@ -252,4 +252,58 @@ start_server {tags {"multi"}} {
|
|||||||
r incr x
|
r incr x
|
||||||
r exec
|
r exec
|
||||||
} {11}
|
} {11}
|
||||||
|
|
||||||
|
test {MULTI / EXEC is propagated correctly (single write command)} {
|
||||||
|
set repl [attach_to_replication_stream]
|
||||||
|
r multi
|
||||||
|
r set foo bar
|
||||||
|
r exec
|
||||||
|
assert_replication_stream $repl {
|
||||||
|
{select *}
|
||||||
|
{multi}
|
||||||
|
{set foo bar}
|
||||||
|
{exec}
|
||||||
|
}
|
||||||
|
close_replication_stream $repl
|
||||||
|
}
|
||||||
|
|
||||||
|
test {MULTI / EXEC is propagated correctly (empty transaction)} {
|
||||||
|
set repl [attach_to_replication_stream]
|
||||||
|
r multi
|
||||||
|
r exec
|
||||||
|
r set foo bar
|
||||||
|
assert_replication_stream $repl {
|
||||||
|
{select *}
|
||||||
|
{set foo bar}
|
||||||
|
}
|
||||||
|
close_replication_stream $repl
|
||||||
|
}
|
||||||
|
|
||||||
|
test {MULTI / EXEC is propagated correctly (read-only commands)} {
|
||||||
|
r set foo value1
|
||||||
|
set repl [attach_to_replication_stream]
|
||||||
|
r multi
|
||||||
|
r get foo
|
||||||
|
r exec
|
||||||
|
r set foo value2
|
||||||
|
assert_replication_stream $repl {
|
||||||
|
{select *}
|
||||||
|
{set foo value2}
|
||||||
|
}
|
||||||
|
close_replication_stream $repl
|
||||||
|
}
|
||||||
|
|
||||||
|
test {MULTI / EXEC is propagated correctly (write command, no effect)} {
|
||||||
|
r del bar foo bar
|
||||||
|
set repl [attach_to_replication_stream]
|
||||||
|
r multi
|
||||||
|
r del foo
|
||||||
|
r exec
|
||||||
|
assert_replication_stream $repl {
|
||||||
|
{select *}
|
||||||
|
{multi}
|
||||||
|
{exec}
|
||||||
|
}
|
||||||
|
close_replication_stream $repl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user