Skip to content

Commit

Permalink
fix: broken tx retris for cluster clients after #697
Browse files Browse the repository at this point in the history
Signed-off-by: Rueian <[email protected]>
  • Loading branch information
rueian committed Dec 24, 2024
1 parent fbdca04 commit e5cfe35
Show file tree
Hide file tree
Showing 2 changed files with 475 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func (c *clusterClient) doresultfn(
}
for ei = i; ei < len(commands) && !isMulti(commands[ei]) && !isExec(commands[ei]); ei++ {
}
if mi >= 0 && mi < ei && ei < len(commands) && isMulti(commands[mi]) && isExec(commands[ei]) && resps[mi].val.string == ok { // a transaction is found.
if mi >= 0 && ei < len(commands) && isMulti(commands[mi]) && isExec(commands[ei]) && resps[mi].val.string == ok { // a transaction is found.
mu.Lock()
retries.Redirects++
nr := retries.m[nc]
Expand All @@ -703,7 +703,7 @@ func (c *clusterClient) doresultfn(
continue // the transaction has been added to the retries, go to the next cmd.
}
}
if hasInit && mi < i && i < ei && mi >= 0 && ei < len(commands) && isMulti(commands[mi]) {
if hasInit && mi < i && i < ei && mi >= 0 && isMulti(commands[mi]) {
continue // the current cmd is in the processed transaction and has been added to the retries.
}
mu.Lock()
Expand Down
Loading

0 comments on commit e5cfe35

Please sign in to comment.