2018-05-15 11:33:21 -04:00
|
|
|
# Test replication of blocking lists and zset operations.
|
|
|
|
# Unlike stream operations such operations are "pop" style, so they consume
|
|
|
|
# the list or sorted set, and must be replicated correctly.
|
|
|
|
|
2019-09-12 03:56:54 -04:00
|
|
|
proc start_bg_block_op {host port db ops tls} {
|
2018-05-15 11:33:21 -04:00
|
|
|
set tclsh [info nameofexecutable]
|
2019-09-12 03:56:54 -04:00
|
|
|
exec $tclsh tests/helpers/bg_block_op.tcl $host $port $db $ops $tls &
|
2018-05-15 11:33:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
proc stop_bg_block_op {handle} {
|
|
|
|
catch {exec /bin/kill -9 $handle}
|
|
|
|
}
|
|
|
|
|
2021-06-09 08:13:24 -04:00
|
|
|
start_server {tags {"repl" "external:skip"}} {
|
2018-05-15 11:33:21 -04:00
|
|
|
start_server {} {
|
|
|
|
set master [srv -1 client]
|
|
|
|
set master_host [srv -1 host]
|
|
|
|
set master_port [srv -1 port]
|
|
|
|
set slave [srv 0 client]
|
|
|
|
|
2019-09-12 03:56:54 -04:00
|
|
|
set load_handle0 [start_bg_block_op $master_host $master_port 9 100000 $::tls]
|
|
|
|
set load_handle1 [start_bg_block_op $master_host $master_port 9 100000 $::tls]
|
|
|
|
set load_handle2 [start_bg_block_op $master_host $master_port 9 100000 $::tls]
|
2018-05-15 11:33:21 -04:00
|
|
|
|
|
|
|
test {First server should have role slave after SLAVEOF} {
|
|
|
|
$slave slaveof $master_host $master_port
|
|
|
|
after 1000
|
|
|
|
s 0 role
|
|
|
|
} {slave}
|
|
|
|
|
2018-05-15 11:43:04 -04:00
|
|
|
test {Test replication with blocking lists and sorted sets operations} {
|
2018-05-15 11:33:21 -04:00
|
|
|
after 25000
|
|
|
|
stop_bg_block_op $load_handle0
|
|
|
|
stop_bg_block_op $load_handle1
|
|
|
|
stop_bg_block_op $load_handle2
|
stabilize tests that involved with load handlers (#8967)
When test stop 'load handler' by killing the process that generating the load,
some commands that already in the input buffer, still might be processed by the server.
This may cause some instability in tests, that count on that no more commands
processed after we stop the `load handler'
In this commit, new proc 'wait_load_handlers_disconnected' added, to verify that no more
cammands from any 'load handler' prossesed, by checking that the clients who
genreate the load is disconnceted.
Also, replacing check of dbsize with wait_for_ofs_sync before comparing debug digest, as
it would fail in case the last key the workload wrote was an overridden key (not a new one).
Affected tests
Race fix:
- failover command to specific replica works
- Connect multiple replicas at the same time (issue #141), master diskless=$mdl, replica diskless=$sdl
- AOF rewrite during write load: RDB preamble=$rdbpre
Cleanup and speedup:
- Test replication with blocking lists and sorted sets operations
- Test replication with parallel clients writing in different DBs
- Test replication partial resync: $descr (diskless: $mdl, $sdl, reconnect: $reconnect
2021-05-20 08:29:43 -04:00
|
|
|
wait_for_condition 100 100 {
|
|
|
|
[$master debug digest] == [$slave debug digest]
|
|
|
|
} else {
|
2018-05-15 11:33:21 -04:00
|
|
|
set csv1 [csvdump r]
|
|
|
|
set csv2 [csvdump {r -1}]
|
|
|
|
set fd [open /tmp/repldump1.txt w]
|
|
|
|
puts -nonewline $fd $csv1
|
|
|
|
close $fd
|
|
|
|
set fd [open /tmp/repldump2.txt w]
|
|
|
|
puts -nonewline $fd $csv2
|
|
|
|
close $fd
|
stabilize tests that involved with load handlers (#8967)
When test stop 'load handler' by killing the process that generating the load,
some commands that already in the input buffer, still might be processed by the server.
This may cause some instability in tests, that count on that no more commands
processed after we stop the `load handler'
In this commit, new proc 'wait_load_handlers_disconnected' added, to verify that no more
cammands from any 'load handler' prossesed, by checking that the clients who
genreate the load is disconnceted.
Also, replacing check of dbsize with wait_for_ofs_sync before comparing debug digest, as
it would fail in case the last key the workload wrote was an overridden key (not a new one).
Affected tests
Race fix:
- failover command to specific replica works
- Connect multiple replicas at the same time (issue #141), master diskless=$mdl, replica diskless=$sdl
- AOF rewrite during write load: RDB preamble=$rdbpre
Cleanup and speedup:
- Test replication with blocking lists and sorted sets operations
- Test replication with parallel clients writing in different DBs
- Test replication partial resync: $descr (diskless: $mdl, $sdl, reconnect: $reconnect
2021-05-20 08:29:43 -04:00
|
|
|
fail "Master - Replica inconsistency, Run diff -u against /tmp/repldump*.txt for more info"
|
2018-05-15 11:33:21 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|