MULTI: some commands should not be allowed in multi/exec#5666
Closed
soloestoy wants to merge 2 commits intoredis:unstablefrom
Closed
MULTI: some commands should not be allowed in multi/exec#5666soloestoy wants to merge 2 commits intoredis:unstablefrom
soloestoy wants to merge 2 commits intoredis:unstablefrom
Conversation
a0d0306 to
5d8405d
Compare
Contributor
Author
|
And this one @antirez . |
Contributor
|
I'm not sure this is a good idea since this is strictly a backwards incompatible change. Someone may be using this, it seems like we should just make multi-exec more robust and not-vulnerable to these edge cases. Thoughts? |
Collaborator
|
Arguably, if someone is using it and counting on this behavior (why?!) then even fixing it in a more generic and robust way would still introduce a breaking change. @soloestoy Did you encounter this in a real world scenario? |
Member
|
closing in favor of #10015 |
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.
Hi @antirez , we had a discussion about forbidden some commands in lua script in #4835.
But now I just found some commands are dangerous in multi/exec too... for instance:
We have a master instance listening on port 6379, and an replica listening on 7788, then execute
REPLICAOFcommand in multi/exec on master:But the replica has nothing:
It's because in multi/exec after
REPLICAOF 127.0.0.1 1234the master became an replica, then write commands would not be replicated, neither therepl_backlog.So, I think we should forbid some replication commands like
REPLICAOF,SYNC,PSYNC.I know this is a corner case, but it really can lead to data inconsistency between master and replica.