2024-04-24 18:54:52 +00:00
|
|
|
source tests/support/valkey.tcl
|
2018-05-15 15:33:21 +00:00
|
|
|
source tests/support/util.tcl
|
|
|
|
|
2019-09-12 07:56:54 +00:00
|
|
|
set ::tlsdir "tests/tls"
|
|
|
|
|
2018-05-15 15:33:21 +00:00
|
|
|
# This function sometimes writes sometimes blocking-reads from lists/sorted
|
|
|
|
# sets. There are multiple processes like this executing at the same time
|
|
|
|
# so that we have some chance to trap some corner condition if there is
|
|
|
|
# a regression. For this to happen it is important that we narrow the key
|
|
|
|
# space to just a few elements, and balance the operations so that it is
|
|
|
|
# unlikely that lists and zsets just get more data without ever causing
|
|
|
|
# blocking.
|
2019-09-12 07:56:54 +00:00
|
|
|
proc bg_block_op {host port db ops tls} {
|
2024-04-18 13:57:17 +00:00
|
|
|
set r [valkey $host $port 0 $tls]
|
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 12:29:43 +00:00
|
|
|
$r client setname LOAD_HANDLER
|
2018-05-15 15:33:21 +00:00
|
|
|
$r select $db
|
|
|
|
|
|
|
|
for {set j 0} {$j < $ops} {incr j} {
|
|
|
|
|
|
|
|
# List side
|
|
|
|
set k list_[randomInt 10]
|
|
|
|
set k2 list_[randomInt 10]
|
|
|
|
set v [randomValue]
|
|
|
|
|
|
|
|
randpath {
|
|
|
|
randpath {
|
|
|
|
$r rpush $k $v
|
|
|
|
} {
|
|
|
|
$r lpush $k $v
|
|
|
|
}
|
|
|
|
} {
|
|
|
|
$r blpop $k 2
|
|
|
|
} {
|
|
|
|
$r blpop $k $k2 2
|
|
|
|
}
|
|
|
|
|
|
|
|
# Zset side
|
|
|
|
set k zset_[randomInt 10]
|
|
|
|
set k2 zset_[randomInt 10]
|
2018-05-15 15:43:04 +00:00
|
|
|
set v1 [randomValue]
|
|
|
|
set v2 [randomValue]
|
2018-05-15 15:33:21 +00:00
|
|
|
|
|
|
|
randpath {
|
|
|
|
$r zadd $k [randomInt 10000] $v
|
|
|
|
} {
|
2018-05-15 15:43:04 +00:00
|
|
|
$r zadd $k [randomInt 10000] $v [randomInt 10000] $v2
|
2018-05-15 15:33:21 +00:00
|
|
|
} {
|
|
|
|
$r bzpopmin $k 2
|
|
|
|
} {
|
|
|
|
$r bzpopmax $k 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-12 07:56:54 +00:00
|
|
|
bg_block_op [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3] [lindex $argv 4]
|