Skip to content

Commit

Permalink
rename procedure redis_deferring_client to valkey_deferring_client (v…
Browse files Browse the repository at this point in the history
…alkey-io#270)

Updated procedure redis_deferring_client in test environent to
valkey_deferring_client.

Signed-off-by: Shivshankar-Reddy <[email protected]>
  • Loading branch information
Shivshankar-Reddy authored Apr 9, 2024
1 parent c0cef48 commit da831c0
Show file tree
Hide file tree
Showing 56 changed files with 398 additions and 398 deletions.
2 changes: 1 addition & 1 deletion src/logreqres.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void reqresReset(client *c, int free_buf) {
* Ideally, we would just have this code inside reqresAppendRequest, which is called
* from processCommand, but we cannot save the reply offset inside processCommand
* because of the following pipe-lining scenario:
* set rd [redis_deferring_client]
* set rd [valkey_deferring_client]
* set buf ""
* append buf "SET key vale\r\n"
* append buf "BLPOP mylist 0\r\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster/tests/16-transactions-on-replica.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test "MULTI-EXEC with write operations is MOVED" {
}

test "read-only blocking operations from replica" {
set rd [redis_deferring_client redis 1]
set rd [valkey_deferring_client redis 1]
$rd readonly
$rd read
$rd XREAD BLOCK 0 STREAMS k 0
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster/tests/17-diskless-load-swapdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test "Main db not affected when fail to diskless load" {
# backlog size is very small, and dumping rdb will cost several seconds.
set num 10000
set value [string repeat A 1024]
set rd [redis_deferring_client redis $master_id]
set rd [valkey_deferring_client redis $master_id]
for {set j 0} {$j < $num} {incr j} {
$rd set $j $value
}
Expand Down
12 changes: 6 additions & 6 deletions tests/cluster/tests/25-pubsubshard-slot-migration.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test "Migrate a slot, verify client receives sunsubscribe on primary serving the
array set nodefrom [$cluster masternode_for_slot $slot]
array set nodeto [$cluster masternode_notfor_slot $slot]

set subscribeclient [redis_deferring_client_by_addr $nodefrom(host) $nodefrom(port)]
set subscribeclient [valkey_deferring_client_by_addr $nodefrom(host) $nodefrom(port)]

$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
Expand Down Expand Up @@ -64,7 +64,7 @@ test "Client subscribes to multiple channels, migrate a slot, verify client rece
array set nodefrom [$cluster masternode_for_slot $slot]
array set nodeto [$cluster masternode_notfor_slot $slot]

set subscribeclient [redis_deferring_client_by_addr $nodefrom(host) $nodefrom(port)]
set subscribeclient [valkey_deferring_client_by_addr $nodefrom(host) $nodefrom(port)]

$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
Expand Down Expand Up @@ -113,7 +113,7 @@ test "Migrate a slot, verify client receives sunsubscribe on replica serving the
set replica_addr [get_addr_replica_serving_slot $slot]
set replicahost [lindex $replica_addr 0]
set replicaport [lindex $replica_addr 1]
set subscribeclient [redis_deferring_client_by_addr $replicahost $replicaport]
set subscribeclient [valkey_deferring_client_by_addr $replicahost $replicaport]

$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
Expand Down Expand Up @@ -148,7 +148,7 @@ test "Move a replica to another primary, verify client receives sunsubscribe on
set replica_host [lindex $replica_addr 0]
set replica_port [lindex $replica_addr 1]
set replica_client [redis_client_by_addr $replica_host $replica_port]
set subscribeclient [redis_deferring_client_by_addr $replica_host $replica_port]
set subscribeclient [valkey_deferring_client_by_addr $replica_host $replica_port]

$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
Expand All @@ -174,7 +174,7 @@ test "Delete a slot, verify sunsubscribe message" {

array set primary_client [$cluster masternode_for_slot $slot]

set subscribeclient [redis_deferring_client_by_addr $primary_client(host) $primary_client(port)]
set subscribeclient [valkey_deferring_client_by_addr $primary_client(host) $primary_client(port)]
$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
$subscribeclient read
Expand All @@ -195,7 +195,7 @@ test "Reset cluster, verify sunsubscribe message" {

array set primary_client [$cluster masternode_for_slot $slot]

set subscribeclient [redis_deferring_client_by_addr $primary_client(host) $primary_client(port)]
set subscribeclient [valkey_deferring_client_by_addr $primary_client(host) $primary_client(port)]
$subscribeclient deferred 1
$subscribeclient ssubscribe $channelname
$subscribeclient read
Expand Down
20 changes: 10 additions & 10 deletions tests/cluster/tests/26-pubsubshard.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ test "Pub/Sub shard basics" {
array set notshardnode [$cluster masternode_notfor_slot $slot]

set publishclient [redis_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient2 [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set anotherclient [redis_deferring_client_by_addr $notshardnode(host) $notshardnode(port)]
set subscribeclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient2 [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set anotherclient [valkey_deferring_client_by_addr $notshardnode(host) $notshardnode(port)]

$subscribeclient ssubscribe channel.0
$subscribeclient read
Expand Down Expand Up @@ -58,7 +58,7 @@ test "client can subscribe to multiple shard channels across different slots in

test "sunsubscribe without specifying any channel would unsubscribe all shard channels subscribed" {
set publishclient [redis_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]

set sub_res [ssubscribe $subscribeclient [list "\{channel.0\}1" "\{channel.0\}2" "\{channel.0\}3"]]
assert_equal [list 1 2 3] $sub_res
Expand All @@ -78,9 +78,9 @@ test "Verify Pub/Sub and Pub/Sub shard no overlap" {
array set notshardnode [$cluster masternode_notfor_slot $slot]

set publishshardclient [redis_client_by_addr $publishnode(host) $publishnode(port)]
set publishclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeshardclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set publishclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeshardclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]

$subscribeshardclient deferred 1
$subscribeshardclient ssubscribe channel.0
Expand Down Expand Up @@ -109,9 +109,9 @@ test "Verify Pub/Sub and Pub/Sub shard no overlap" {
}

test "PUBSUB channels/shardchannels" {
set subscribeclient [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient2 [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient3 [redis_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient2 [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set subscribeclient3 [valkey_deferring_client_by_addr $publishnode(host) $publishnode(port)]
set publishclient [redis_client_by_addr $publishnode(host) $publishnode(port)]

ssubscribe $subscribeclient [list "\{channel.0\}1"]
Expand Down
4 changes: 2 additions & 2 deletions tests/instances.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -717,14 +717,14 @@ proc restart_instance {type id} {
}
}

proc redis_deferring_client {type id} {
proc valkey_deferring_client {type id} {
set port [get_instance_attrib $type $id port]
set host [get_instance_attrib $type $id host]
set client [redis $host $port 1 $::tls]
return $client
}

proc redis_deferring_client_by_addr {host port} {
proc valkey_deferring_client_by_addr {host port} {
set client [redis $host $port 1 $::tls]
return $client
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/aof.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ tags {"aof external:skip"} {

start_server {overrides {appendonly {yes} appendfsync always}} {
test {AOF fsync always barrier issue} {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
# Set a sleep when aof is flushed, so that we have a chance to look
# at the aof size and detect if the response of an incr command
# arrives before the data was written (and hopefully fsynced)
Expand Down Expand Up @@ -438,7 +438,7 @@ tags {"aof external:skip"} {
append_to_aof [formatCommand select 9]
append_to_aof [formatCommand eval {redis.call('set',KEYS[1],'y'); for i=1,1500000 do redis.call('ping') end return 'ok'} 1 x]
}
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd debug loadaof
$rd flush
wait_for_condition 100 10 {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/corrupt-dump-fuzzer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if { ! [ catch {
}

proc generate_collections {suffix elements} {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
for {set j 0} {$j < $elements} {incr j} {
# add both string values and integers
if {$j % 2 == 0} {set val $j} else {set val "_$j"}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/dismiss-mem.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ start_server {tags {"dismiss external:skip"}} {
for {set i 0} {$i < 100} {incr i} {
r lpush mylist $item
}
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd lrange mylist 0 -1
$rd flush
after 100
Expand All @@ -74,7 +74,7 @@ start_server {tags {"dismiss external:skip"}} {
test {dismiss client query buffer} {
# Big pending query buffer
set bigstr [string repeat A 8192]
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd write "*2\r\n\$8192\r\n"
$rd write $bigstr\r\n
$rd flush
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/failover.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ start_server {overrides {save {}}} {
# We pause the target long enough to send a write command
# during the pause. This write will not be interrupted.
pause_process [srv -1 pid]
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd SET FOO BAR
$node_0 failover to $node_1_host $node_1_port
resume_process [srv -1 pid]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/rdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ test {client freed during loading} {
# connect and disconnect 5 clients
set clients {}
for {set j 0} {$j < 5} {incr j} {
lappend clients [redis_deferring_client]
lappend clients [valkey_deferring_client]
}
foreach rd $clients {
$rd debug log bla
Expand Down Expand Up @@ -262,7 +262,7 @@ start_server {overrides {save ""}} {
# populate the db with 10k keys of 512B each (since we want to measure the COW size by
# changing some keys and read the reported COW size, we are using small key size to prevent from
# the "dismiss mechanism" free memory and reduce the COW size)
set rd [redis_deferring_client 0]
set rd [valkey_deferring_client 0]
set size 500 ;# aim for the 512 bin (sds overhead)
set cmd_count 10000
for {set k 0} {$k < $cmd_count} {incr k} {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/replication-buffer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ test {Replica client-output-buffer size is limited to backlog_limit/16 when no r

# Before this fix (#11905), the test would trigger an assertion in 'o->used >= c->ref_block_pos'
test {The update of replBufBlock's repl_offset is ok - Regression test for #11666} {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
set replid [status $master master_replid]
set offset [status $master repl_backlog_first_byte_offset]
$rd psync $replid $offset
Expand Down
22 changes: 11 additions & 11 deletions tests/integration/replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ start_server {tags {"repl external:skip"}} {

test {BRPOPLPUSH replication, when blocking against empty list} {
$A config resetstat
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd brpoplpush a b 5
r lpush a foo
wait_for_condition 50 100 {
Expand All @@ -122,7 +122,7 @@ start_server {tags {"repl external:skip"}} {

test {BRPOPLPUSH replication, list exists} {
$A config resetstat
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
r lpush c 1
r lpush c 2
r lpush c 3
Expand All @@ -137,7 +137,7 @@ start_server {tags {"repl external:skip"}} {
foreach whereto {left right} {
test "BLMOVE ($wherefrom, $whereto) replication, when blocking against empty list" {
$A config resetstat
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd blmove a b $wherefrom $whereto 5
r lpush a foo
wait_for_condition 50 100 {
Expand All @@ -151,7 +151,7 @@ start_server {tags {"repl external:skip"}} {

test "BLMOVE ($wherefrom, $whereto) replication, list exists" {
$A config resetstat
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
r lpush c 1
r lpush c 2
r lpush c 3
Expand All @@ -165,7 +165,7 @@ start_server {tags {"repl external:skip"}} {
}

test {BLPOP followed by role change, issue #2473} {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
$rd blpop foo 0 ; # Block while B is a master

# Turn B into master of A
Expand Down Expand Up @@ -637,7 +637,7 @@ foreach testType {Successful Aborted} {
}

test {Busy script during async loading} {
set rd_replica [redis_deferring_client -1]
set rd_replica [valkey_deferring_client -1]
$replica config set lua-time-limit 10
$rd_replica eval {while true do end} 0
after 200
Expand Down Expand Up @@ -1146,7 +1146,7 @@ test {replicaof right after disconnection} {
fail "Can't turn the instance into a replica"
}

set rd [redis_deferring_client -1]
set rd [valkey_deferring_client -1]
$rd debug sleep 1
after 100

Expand Down Expand Up @@ -1344,7 +1344,7 @@ test {replica can handle EINTR if use diskless load} {

start_server {tags {"repl" "external:skip"}} {
test "replica do not write the reply to the replication link - SYNC (_addReplyToBufferOrList)" {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
set lines [count_log_lines 0]

$rd sync
Expand All @@ -1361,7 +1361,7 @@ start_server {tags {"repl" "external:skip"}} {
}

test "replica do not write the reply to the replication link - SYNC (addReplyDeferredLen)" {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
set lines [count_log_lines 0]

$rd sync
Expand All @@ -1378,7 +1378,7 @@ start_server {tags {"repl" "external:skip"}} {
}

test "replica do not write the reply to the replication link - PSYNC (_addReplyToBufferOrList)" {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
set lines [count_log_lines 0]

$rd psync replicationid -1
Expand All @@ -1398,7 +1398,7 @@ start_server {tags {"repl" "external:skip"}} {
}

test "replica do not write the reply to the replication link - PSYNC (addReplyDeferredLen)" {
set rd [redis_deferring_client]
set rd [valkey_deferring_client]
set lines [count_log_lines 0]

$rd psync replicationid -1
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/shutdown.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ foreach how {sigterm shutdown} {
exec kill -SIGTERM $master_pid
}
shutdown {
set rd [redis_deferring_client -1]
set rd [valkey_deferring_client -1]
$rd shutdown
}
}
Expand Down Expand Up @@ -152,8 +152,8 @@ test "Shutting down master waits for replica then fails" {
$master incr k

# Two clients call blocking SHUTDOWN in parallel.
set rd1 [redis_deferring_client -1]
set rd2 [redis_deferring_client -1]
set rd1 [valkey_deferring_client -1]
set rd2 [valkey_deferring_client -1]
$rd1 shutdown
$rd2 shutdown
set info_clients [$master info clients]
Expand Down Expand Up @@ -205,8 +205,8 @@ test "Shutting down master waits for replica then aborted" {
$master incr k

# Two clients call blocking SHUTDOWN in parallel.
set rd1 [redis_deferring_client -1]
set rd2 [redis_deferring_client -1]
set rd1 [valkey_deferring_client -1]
set rd2 [valkey_deferring_client -1]
$rd1 shutdown
$rd2 shutdown
set info_clients [$master info clients]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ proc reconnect {args} {
lset ::servers end+$level $srv
}

proc redis_deferring_client {args} {
proc valkey_deferring_client {args} {
set level 0
if {[llength $args] > 0 && [string is integer [lindex $args 0]]} {
set level [lindex $args 0]
Expand Down
Loading

0 comments on commit da831c0

Please sign in to comment.