-
Notifications
You must be signed in to change notification settings - Fork 219
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
Push down precondition to TiKV #343
Changes from 7 commits
2ffb9b5
adb1161
0f1acc0
e3b80b3
0cff7b3
8b06592
88aab09
e4d51af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,23 @@ message LockInfo { | |
uint64 lock_ttl = 4; | ||
} | ||
|
||
message AlreadyExist { | ||
bytes key = 1; | ||
} | ||
|
||
message NotEqualTo { | ||
bytes key = 1; | ||
bytes value = 2; | ||
bytes should_equal_to = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about something like |
||
} | ||
|
||
message KeyError { | ||
LockInfo locked = 1; // Client should backoff or cleanup the lock then retry. | ||
string retryable = 2; // Client may restart the txn. e.g write conflict. | ||
string abort = 3; // Client should abort the txn. | ||
WriteConflict conflict = 4; // Write conflict is moved from retryable to here. | ||
AlreadyExist already_exist = 5; // Key already exists | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No error code for the case that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently we only use should_not_exist. |
||
NotEqualTo not_equal_to = 6; // Value not equal to specified value | ||
} | ||
|
||
message WriteConflict { | ||
|
@@ -121,10 +133,19 @@ enum Op { | |
Rollback = 3; | ||
} | ||
|
||
message Precondition { | ||
// Should not exist | ||
bool should_not_exist = 1; | ||
// Value must equal to | ||
bytes equal_to = 2; | ||
} | ||
|
||
message Mutation { | ||
Op op = 1; | ||
bytes key = 2; | ||
bytes value = 3; | ||
// Write only when the precondition satisfied | ||
Precondition precondition = 4; | ||
} | ||
|
||
message PrewriteRequest { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just
NotEqual
orNotMatch
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer NotEqualTo, it's more clear.