summaryrefslogtreecommitdiff
path: root/src/t_stream.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2022-04-20 11:11:21 +0300
committerGitHub <noreply@github.com>2022-04-20 11:11:21 +0300
commitee220599b0481cf4b10e8a5293691258fd6f35a6 (patch)
treeb8e89a5d5014c91016287e97298f3c80f3265d43 /src/t_stream.c
parent046654a70e604413c3a91a97e621351c64b0e6ad (diff)
downloadredis-ee220599b0481cf4b10e8a5293691258fd6f35a6.tar.gz
Fixes around clients that must be obeyed. Replica report disk errors in PING. (#10603)
This PR unifies all the places that test if the current client is the master client or AOF client, and uses a method to test that on all of these. Other than some refactoring, these are the actual implications: - Replicas **don't** ignore disk error when processing commands not coming from their master. **This is important for PING to be used for health check of replicas** - SETRANGE, APPEND, SETBIT, BITFIELD don't do proto_max_bulk_len check for AOF - RM_Call in SCRIPT_MODE ignores disk error when coming from master / AOF - RM_Call in cluster mode ignores slot check when processing AOF - Scripts ignore disk error when processing AOF - Scripts **don't** ignore disk error on a replica, if the command comes from clients other than the master - SCRIPT KILL won't kill script coming from AOF - Scripts **don't** skip OOM check on replica if the command comes from clients other than the master Note that Script, AOF, and module clients don't reach processCommand, which is why some of the changes don't actually have any implications. Note, reverting the change done to processCommand in 2f4240b9d9 should be dead code due to the above mentioned fact.
Diffstat (limited to 'src/t_stream.c')
-rw-r--r--src/t_stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 399c2091c..e6e5da731 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -1000,7 +1000,7 @@ static int streamParseAddOrTrimArgsOrReply(client *c, streamAddTrimArgs *args, i
return -1;
}
- if (c == server.master || c->id == CLIENT_ID_AOF) {
+ if (mustObeyClient(c)) {
/* If command came from master or from AOF we must not enforce maxnodes
* (The maxlen/minid argument was re-written to make sure there's no
* inconsistency). */