summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2022-04-26 02:09:21 -0700
committerGitHub <noreply@github.com>2022-04-26 12:09:21 +0300
commitefcd1bf394668e418df1a93cd28cf9e8b0c09ce5 (patch)
treeaf0d61b1e939aeccd52b6797b01614d91176a128 /src/server.h
parent79ffc3524dc3d1222685cacc236f417d09459bae (diff)
downloadredis-efcd1bf394668e418df1a93cd28cf9e8b0c09ce5.tar.gz
By default prevent cross slot operations in functions and scripts with # (#10615)
Adds the `allow-cross-slot-keys` flag to Eval scripts and Functions to allow scripts to access keys from multiple slots. The default behavior is now that they are not allowed to do that (unlike before). This is a breaking change for 7.0 release candidates (to be part of 7.0.0), but not for previous redis releases since EVAL without shebang isn't doing this check. Note that the check is done on both the keys declared by the EVAL / FCALL command arguments, and also the ones used by the script when making a `redis.call`. A note about the implementation, there seems to have been some confusion about allowing access to non local keys. I thought I missed something in our wider conversation, but Redis scripts do block access to non-local keys. So the issue was just about cross slots being accessed.
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index da4a1ebcd..ef0215fe0 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1107,6 +1107,7 @@ typedef struct client {
buffer or object being sent. */
time_t ctime; /* Client creation time. */
long duration; /* Current command duration. Used for measuring latency of blocking/non-blocking cmds */
+ int slot; /* The slot the client is executing against. Set to -1 if no slot is being used */
time_t lastinteraction; /* Time of the last interaction, used for timeout */
time_t obuf_soft_limit_reached_time;
uint64_t flags; /* Client flags: CLIENT_* macros. */