-
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
Push down precondition to TiKV #343
Conversation
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
@disksing @MyonKeminta PTAL |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
No error code for the case that equal_to
not satisfied?
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.
Currently we only use should_not_exist.
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
bytes key = 1; | ||
} | ||
|
||
message NotEqualTo { |
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
or NotMatch
?
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.
proto/kvrpcpb.proto
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like expected_value
?
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
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.
LGTM
Push down precondition to TiKV, so for INSERT statement with unique constraint, the batch_get is not necessary any more.