Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c47ee903
Commit
c47ee903
authored
Jun 05, 2020
by
antirez
Browse files
TCC: fix clientShouldWaitOnLockedKeys() MULTI bug.
parent
68bc8c75
Changes
1
Show whitespace changes
Inline
Side-by-side
src/db.c
View file @
c47ee903
...
@@ -1881,6 +1881,8 @@ int clientShouldWaitOnLockedKeys(client *c, int queue) {
...
@@ -1881,6 +1881,8 @@ int clientShouldWaitOnLockedKeys(client *c, int queue) {
if (c->flags & CLIENT_MULTI) {
if (c->flags & CLIENT_MULTI) {
for (int j = 0; j < c->mstate.count; j++) {
for (int j = 0; j < c->mstate.count; j++) {
struct redisCommand *cmd = c->mstate.commands[j].cmd;
struct redisCommand *cmd = c->mstate.commands[j].cmd;
robj **argv = c->mstate.commands[j].argv;
int argc = c->mstate.commands[j].argc;
/* Even in the case of transactions, read only commands
/* Even in the case of transactions, read only commands
* do not require we to sleep for the locked keys. */
* do not require we to sleep for the locked keys. */
...
@@ -1888,11 +1890,9 @@ int clientShouldWaitOnLockedKeys(client *c, int queue) {
...
@@ -1888,11 +1890,9 @@ int clientShouldWaitOnLockedKeys(client *c, int queue) {
cmd->proc != evalCommand &&
cmd->proc != evalCommand &&
cmd->proc != evalShaCommand) continue;
cmd->proc != evalShaCommand) continue;
keyidx = getKeysFromCommand(cmd,
keyidx = getKeysFromCommand(cmd,argv,argc,&numkeys);
c->mstate.commands[j].argv,
c->mstate.commands[j].argc,&numkeys);
for (int j = 0; j < numkeys; j++) {
for (int j = 0; j < numkeys; j++) {
if (queueClientIfKeyIsLocked(c,
c->
argv[keyidx[j]],queue))
if (queueClientIfKeyIsLocked(c,argv[keyidx[j]],queue))
locked++;
locked++;
}
}
getKeysFreeResult(keyidx);
getKeysFreeResult(keyidx);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment