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

Push down precondition to TiKV #343

Merged
merged 8 commits into from
Jan 21, 2019

Conversation

zhangjinpeng87
Copy link
Contributor

Push down precondition to TiKV, so for INSERT statement with unique constraint, the batch_get is not necessary any more.

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>
@zhangjinpeng87
Copy link
Contributor Author

@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
Copy link
Contributor

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?

Copy link
Contributor Author

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>
disksing
disksing previously approved these changes Jan 21, 2019
bytes key = 1;
}

message NotEqualTo {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

message NotEqualTo {
bytes key = 1;
bytes value = 2;
bytes should_equal_to = 3;
Copy link
Contributor

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>
Copy link
Contributor

@MyonKeminta MyonKeminta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangjinpeng87 zhangjinpeng87 merged commit be0b43e into pingcap:master Jan 21, 2019
BusyJay pushed a commit to BusyJay/kvproto that referenced this pull request Jan 25, 2019
sticnarf pushed a commit to sticnarf/kvproto that referenced this pull request Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants