Scripting: forbid non deterministic WRITE commands#5208
Closed
soloestoy wants to merge 3 commits intoredis:unstablefrom
Closed
Scripting: forbid non deterministic WRITE commands#5208soloestoy wants to merge 3 commits intoredis:unstablefrom
soloestoy wants to merge 3 commits intoredis:unstablefrom
Conversation
Contributor
Author
|
BTW, I think maybe we should take diff --git a/src/server.c b/src/server.c
index 66d42ee..28a9e9d 100644
--- a/src/server.c
+++ b/src/server.c
@@ -229,10 +229,10 @@ struct redisCommand redisCommandTable[] = {
{"move",moveCommand,3,"wF",0,NULL,1,1,1,0,0},
{"rename",renameCommand,3,"w",0,NULL,1,2,1,0,0},
{"renamenx",renamenxCommand,3,"wF",0,NULL,1,2,1,0,0},
- {"expire",expireCommand,3,"wF",0,NULL,1,1,1,0,0},
- {"expireat",expireatCommand,3,"wF",0,NULL,1,1,1,0,0},
- {"pexpire",pexpireCommand,3,"wF",0,NULL,1,1,1,0,0},
- {"pexpireat",pexpireatCommand,3,"wF",0,NULL,1,1,1,0,0},
+ {"expire",expireCommand,3,"wRF",0,NULL,1,1,1,0,0},
+ {"expireat",expireatCommand,3,"wRF",0,NULL,1,1,1,0,0},
+ {"pexpire",pexpireCommand,3,"wRF",0,NULL,1,1,1,0,0},
+ {"pexpireat",pexpireatCommand,3,"wRF",0,NULL,1,1,1,0,0},
{"keys",keysCommand,2,"rS",0,NULL,0,0,0,0,0},
{"scan",scanCommand,-2,"rR",0,NULL,0,0,0,0,0},
{"dbsize",dbsizeCommand,1,"rF",0,NULL,0,0,0,0,0},But some user's lua script have to call |
5e1c58c to
8bca375
Compare
Contributor
Author
|
No need to take expire as random commands, just forbid deleting by expire from lua scripts is OK. |
5d9d2b1 to
495087b
Compare
This was referenced Aug 28, 2018
Contributor
|
Thanks, I'll check this one today. |
oranagra
reviewed
May 4, 2021
Member
oranagra
left a comment
There was a problem hiding this comment.
@soloestoy i'm not sure i see the connection between the title (talking about SPOP) and the implementation (change in expireGenericCommand).
is that related to the change you did in luaRedisGenericCommand? can you please explain it to me?
Member
Member
|
no longer relevant, script propagation was deprecated in #9812 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some non deterministic WRITE commands like
SPOPshould not be allowed in lua script.