Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

Fix ResolveLock not called in Scan API - #2089

Merged
birdstorm merged 2 commits into
pingcap:masterfrom
birdstorm:fix-resolve-lock-in-scan
Jul 30, 2021
Merged

birdstorm merged 2 commits into
pingcap:masterfrom
birdstorm:fix-resolve-lock-in-scan

Conversation

@birdstorm

Copy link
Copy Markdown
Contributor

ResolveLock was not called in Scan API, it would lead to

  • Sometimes the table/database info was not retrieved from TiKV, e.g., table or view not found
  • Scan API may not get all KV pairs if some of them are locked by another transaction.

fix resolve lock not called in Scan API

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
@birdstorm birdstorm added needs-cherry-pick-2.3 needs-cherry-pick-release-2.4 PR which needs to be cherry-picked to release-2.4 labels Jul 23, 2021
@birdstorm
birdstorm requested a review from marsishandsome July 23, 2021 09:24
@birdstorm

Copy link
Copy Markdown
Contributor Author

/run-all-tests tidb=v5.0.3 tikv=v5.0.3 pd=v5.0.3

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
@birdstorm

Copy link
Copy Markdown
Contributor Author

/run-all-tests tidb=v5.0.3 tikv=v5.0.3 pd=v5.0.3

@marsishandsome marsishandsome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this PR should port to client-java ?

while (iterator.hasNext()) {
Kvrpcpb.KvPair kv = iterator.next();
if (kv == null || kv.getKey() == null) {
if (kv == null || kv.getKey().isEmpty()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (kv == null || kv.getKey().isEmpty()) {
if (kv == null || kv.getKey() == null || kv.getKey().isEmpty()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@marsishandsome key is non-null

@marsishandsome marsishandsome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@birdstorm

Copy link
Copy Markdown
Contributor Author

/merge

@birdstorm
birdstorm merged commit ddbf7d3 into pingcap:master Jul 30, 2021
@birdstorm
birdstorm deleted the fix-resolve-lock-in-scan branch July 30, 2021 07:11
@ti-srebot

Copy link
Copy Markdown
Contributor

cherry pick to release-2.3 in PR #2090

@ti-srebot

Copy link
Copy Markdown
Contributor

cherry pick to release-2.4 in PR #2091

birdstorm pushed a commit that referenced this pull request Aug 2, 2021
fix resolve lock not called in Scan API

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
birdstorm added a commit that referenced this pull request Sep 6, 2021
* fix v2.4 scan bug

fix resolve lock not called in Scan API

Signed-off-by: birdstorm <samuelwyf@hotmail.com>

* remove backoff

Signed-off-by: birdstorm <samuelwyf@hotmail.com>

Co-authored-by: birdstorm <samuelwyf@hotmail.com>
wfxxh pushed a commit to wanfangdata/tispark that referenced this pull request Jun 30, 2023
Signed-off-by: birdstorm <samuelwyf@hotmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-cherry-pick-release-2.4 PR which needs to be cherry-picked to release-2.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants