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

[to #656] Fix scan with lock (#670) #697

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Dec 29, 2022

cherry-pick #670 to release-3.3
You can switch your code base to this Pull Request by using git-extras:

# In client-java repo:
git pr https://github.com/tikv/client-java/pull/697

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/client-java.git pr/697:release-3.3-a459a6ed3afd

What problem does this PR solve?

Issue Number: close #656

Problem Description: Catalog get table API return null sometimes

What is changed and how does it work?

Add resolve locks to scan implementation.

See the issue analysis here.

Code changes

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
while (true) {
    TiConfiguration conf = TiConfiguration.createDefault("172.16.5.32:44379");
    try (TiSession session = TiSession.create(conf)) {
      Catalog catalog = session.getCatalog();
      TiDBInfo db = catalog.getDatabase("sbtest");
      Objects.requireNonNull(db, "db is null");
    }
}

Side effects

  • Increased code complexity, WHY: Add resolve locks for scan

Related changes

  • Need to cherry-pick to the release branch

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator Author

/run-all-tests

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

❗ No coverage uploaded for pull request base (release-3.3@82c99e2). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@              Coverage Diff               @@
##             release-3.3     #697   +/-   ##
==============================================
  Coverage               ?   37.20%           
  Complexity             ?     1564           
==============================================
  Files                  ?      278           
  Lines                  ?    17386           
  Branches               ?     1978           
==============================================
  Hits                   ?     6468           
  Misses                 ?    10268           
  Partials               ?      650           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zhangyangyu zhangyangyu merged commit a345184 into tikv:release-3.3 Dec 29, 2022
shiyuhang0 pushed a commit to shiyuhang0/client-java that referenced this pull request Dec 30, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Co-authored-by: Ping Yu <yuping@pingcap.com>
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.

None yet

3 participants