Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transaction #285

Merged
merged 4 commits into from
Jun 3, 2021
Merged

Support transaction #285

merged 4 commits into from
Jun 3, 2021

Conversation

ShooterIT
Copy link
Member

@ShooterIT ShooterIT commented Jun 1, 2021

Backgroud

As we know, redis support transaction, I prefer to call it MULTI-EXEC since it just excute multiple commands and can't be broken. But kvrocks can't support that. Especially, kvrocks doesn't support sufficient commands, we also combine many commands to impelment our logic. So MULTI-EXEC is much needed.

Implementation

If users send MULTI, kvrocks doesn't execute commands, just queue them into multi-cmds list. After receiving EXEC, kvrocks will execute all queued commands.
Currently, it is easy to hang up other threads by ExclusiveGuard, so it won't be broken when we execute all commands.

The same as redis, kvrocks may abort transaction when occuring errors before we queue commands.

And we also support DISCARD to abort transaction.

Disadvantage

Currently, we don't support WATCH and UNWATCH commands.

ShooterIT added 3 commits June 1, 2021 21:22
Change-Id: I2797dede68d58ea402e7da49dead7508c1226943
@ShooterIT ShooterIT added major decision Requires project management committee consensus release notes labels Jun 2, 2021
@ShooterIT ShooterIT requested review from git-hulk and karelrooted and removed request for git-hulk June 2, 2021 14:11
@ShooterIT ShooterIT changed the title Support MULTI-EXEC Support transaction Jun 3, 2021
@ShooterIT ShooterIT merged commit 8d78a6d into apache:unstable Jun 3, 2021
@ShooterIT ShooterIT deleted the multi-exec branch June 3, 2021 13:52
ShooterIT added a commit to ShooterIT/kvrocks that referenced this pull request Jul 15, 2021
Kvrocks supports transaction, very simmer with Redis, we support MULTI,
EXEC, DISCARD commands.
But now, we don't support WATCH and UNWATCH commands.
@ShooterIT ShooterIT mentioned this pull request Jul 15, 2021
ShooterIT added a commit that referenced this pull request Jul 19, 2021
Kvrocks supports transaction, very simmer with Redis, we support MULTI,
EXEC, DISCARD commands.
But now, we don't support WATCH and UNWATCH commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major decision Requires project management committee consensus release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants