-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new CLIENT CAPA command along with other related modifications (#…
…151) to valkey-io/valkey#325 --------- Signed-off-by: zhaozhao.zz <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
- Loading branch information
1 parent
c8644e8
commit dcee122
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Clients can declare their capabilities to Valkey using the `CLIENT CAPA` command, and Valkey | ||
will adjust the corresponding features for the current connection based on the declared client capabilities. | ||
|
||
Multiple capabilities can be declared in the command. If any capabilities are unrecognized, | ||
Valkey will ignore them instead of returning an error. | ||
|
||
The capabilities currently supported are: | ||
|
||
* `redirect` - This indicates that the client is capable of handling redirect messages. | ||
When accessing a replica node in standalone mode, if a data operation is performed (read or write commands), | ||
Valkey will return `-REDIRECT primary-ip:port` to this connection. | ||
Using the `READONLY` command can enable this connection to execute read commands on the replica node. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
Disables read queries for a connection to a Valkey Cluster replica node. | ||
Disables read queries for a connection to a Valkey replica node. | ||
|
||
Read queries against a Valkey Cluster replica node are disabled by default, | ||
but you can use the `READONLY` command to change this behavior on a per- | ||
Read queries against a Valkey Cluster replica node are disabled by default. | ||
|
||
For standalone replica nodes, since Valkey 8.0, read queries are also disabled | ||
for clients that have executed the `CLIENT CAPA redirect` command. | ||
|
||
But you can use the `READONLY` command to change this behavior on a per- | ||
connection basis. The `READWRITE` command resets the readonly mode flag | ||
of a connection back to readwrite. |