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

http: add region-id when getting mvcc by handle #11436

Merged
merged 12 commits into from
Aug 1, 2019

Conversation

imtbkcat
Copy link

What problem does this PR solve?

return region id when getting mvcc info by handle.

What is changed and how it works?

Add region-id field, and get region info in handleMvccGetByKey.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported variable/fields change

Side effects

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #11436 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11436   +/-   ##
===========================================
  Coverage   81.2701%   81.2701%           
===========================================
  Files           425        425           
  Lines         92067      92067           
===========================================
  Hits          74823      74823           
  Misses        11860      11860           
  Partials       5384       5384

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 26, 2019
@@ -1293,6 +1310,9 @@ func (h mvccTxnHandler) handleMvccGetByKey(params map[string]string, decodeData
colMap[col.ID] = &col.FieldType
}

if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

why add these lines?

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

rest LGTM

Value *kvrpcpb.MvccGetByKeyResponse `json:"value"`
Key string `json:"key"`
Value *kvrpcpb.MvccGetByKeyResponse `json:"value"`
RegionID uint64 `json:"region-id"`
Copy link
Member

Choose a reason for hiding this comment

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

It is better to use region_id.

if err != nil {
return nil, errors.Trace(err)
}
keyLocation, err := t.RegionCache.LocateKey(tikv.NewBackoffer(context.Background(), 500), encodedKey)
Copy link
Member

Choose a reason for hiding this comment

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

There are many similar code like this. It is better to extract a function for it.

Copy link
Author

Choose a reason for hiding this comment

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

PTAL @jackysp

@imtbkcat
Copy link
Author

/run-all-tests

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp jackysp added the status/can-merge Indicates a PR has been approved by a committer. label Jul 31, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Jul 31, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Jul 31, 2019

@imtbkcat merge failed.

@imtbkcat
Copy link
Author

imtbkcat commented Aug 1, 2019

/run-all-tests

@imtbkcat imtbkcat merged commit 7b63293 into pingcap:master Aug 1, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 1, 2019

cherry pick to release-2.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Aug 1, 2019

cherry pick to release-3.0 in PR #11557

@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

It seems that, not for sure, we failed to cherry-pick this commit to release-2.1. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @imtbkcat PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants