Skip to content

Commit

Permalink
Rename __redis__:invalidate to __valkey__:invalidate from client-side…
Browse files Browse the repository at this point in the history
…-caching

Signed-off-by: NAM UK KIM <namuk2004@naver.com>
  • Loading branch information
Virusuki committed May 1, 2024
1 parent cf608e3 commit 0d31e45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void enableTracking(client *c, uint64_t redirect_to, uint64_t options, robj **pr
if (TrackingTable == NULL) {
TrackingTable = raxNew();
PrefixTable = raxNew();
TrackingChannelName = createStringObject("__redis__:invalidate",20);
TrackingChannelName = createStringObject("__valkey__:invalidate",20);
}

/* For broadcasting, set the list of prefixes in the client. */
Expand Down Expand Up @@ -303,7 +303,7 @@ void sendTrackingMessage(client *c, char *keyname, size_t keylen, int proto) {
/* Only send such info for clients in RESP version 3 or more. However
* if redirection is active, and the connection we redirect to is
* in Pub/Sub mode, we can support the feature with RESP 2 as well,
* by sending Pub/Sub messages in the __redis__:invalidate channel. */
* by sending Pub/Sub messages in the __valkey__:invalidate channel. */
if (c->resp > 2) {
addReplyPushLen(c,2);
addReplyBulkCBuffer(c,"invalidate",10);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/client-eviction.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ start_server {} {
set redirected_c [valkey_client]
$redirected_c client setname redirected_client
set redir_id [$redirected_c client id]
$redirected_c SUBSCRIBE __redis__:invalidate
$redirected_c SUBSCRIBE __valkey__:invalidate
$rr client tracking on redirect $redir_id bcast
# Use a big key name to fill the redirected tracking client's buffer quickly
set key_length [expr 1024*200]
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/tracking.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ start_server {tags {"tracking network logreqres:skip"}} {
set rd_redirection [valkey_deferring_client]
$rd_redirection client id
set redir_id [$rd_redirection read]
$rd_redirection subscribe __redis__:invalidate
$rd_redirection subscribe __valkey__:invalidate
$rd_redirection read ; # Consume the SUBSCRIBE reply.

# Create another client that's not used as a redirection client
Expand All @@ -28,7 +28,7 @@ start_server {tags {"tracking network logreqres:skip"}} {
set rd_redirection [valkey_deferring_client]
$rd_redirection client id
set redir_id [$rd_redirection read]
$rd_redirection subscribe __redis__:invalidate
$rd_redirection subscribe __valkey__:invalidate
$rd_redirection read ; # Consume the SUBSCRIBE reply.
r FLUSHALL
r HELLO 2
Expand Down Expand Up @@ -272,7 +272,7 @@ start_server {tags {"tracking network logreqres:skip"}} {
set rd_redirection [valkey_deferring_client]
$rd_redirection CLIENT ID
set redir_id [$rd_redirection read]
$rd_redirection SUBSCRIBE __redis__:invalidate
$rd_redirection SUBSCRIBE __valkey__:invalidate
$rd_redirection read ; # Consume the SUBSCRIBE reply
}

Expand Down Expand Up @@ -360,15 +360,15 @@ start_server {tags {"tracking network logreqres:skip"}} {
}

test {Able to redirect to a RESP3 client} {
$rd_redirection UNSUBSCRIBE __redis__:invalidate ; # Need to unsub first before we can do HELLO 3
$rd_redirection UNSUBSCRIBE __valkey__:invalidate ; # Need to unsub first before we can do HELLO 3
set res [$rd_redirection read] ; # Consume the UNSUBSCRIBE reply
assert_equal {__redis__:invalidate} [lindex $res 1]
assert_equal {__valkey__:invalidate} [lindex $res 1]
$rd_redirection HELLO 3
set res [$rd_redirection read] ; # Consume the HELLO reply
assert_equal [dict get $reply proto] 3
$rd_redirection SUBSCRIBE __redis__:invalidate
$rd_redirection SUBSCRIBE __valkey__:invalidate
set res [$rd_redirection read] ; # Consume the SUBSCRIBE reply
assert_equal {__redis__:invalidate} [lindex $res 1]
assert_equal {__valkey__:invalidate} [lindex $res 1]
r CLIENT TRACKING on REDIRECT $redir_id
$rd_sg SET key1 1
r GET key1
Expand Down

0 comments on commit 0d31e45

Please sign in to comment.