Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

loader: fix concurrent usage of checkpoint's DBconn. (#552) #554

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

sre-bot
Copy link

@sre-bot sre-bot commented Mar 18, 2020

cherry-pick #552 to release-1.0


What problem does this PR solve?

fix #553

  • for load unit, only one RemoteCheckPoint exists.
  • for RemoteCheckPoint, only one DBConn exist.
  • but DBConn is not concurrency-safe.

so, some checkpoint operations like Init may cause a problem.

What is changed and how it works?

add sync.Mutex to protect operations for DBConn.

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Possible performance regression
  • Increased code complexity

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note

@sre-bot sre-bot added needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated priority/normal Minor change, requires approval from ≥1 primary reviewer type/bug-fix Bug fix type/cherry-pick This PR is just a cherry-pick (backport) labels Mar 18, 2020
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

@WangXiangUSTC WangXiangUSTC added status/LGT1 One reviewer already commented LGTM and removed type/cherry-pick This PR is just a cherry-pick (backport) labels Mar 18, 2020
@csuzhangxc csuzhangxc added this to the v1.0.5 milestone Mar 18, 2020
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Mar 18, 2020

Codecov Report

Merging #554 into release-1.0 will increase coverage by 0.0718%.
The diff coverage is 72.2222%.

@@                 Coverage Diff                 @@
##           release-1.0       #554        +/-   ##
===================================================
+ Coverage      57.2955%   57.3674%   +0.0718%     
===================================================
  Files              161        161                
  Lines            16654      16668        +14     
===================================================
+ Hits              9542       9562        +20     
+ Misses            6171       6165         -6     
  Partials           941        941

@csuzhangxc csuzhangxc merged commit 4edb1a4 into pingcap:release-1.0 Mar 18, 2020
@csuzhangxc csuzhangxc added already-update-release-note The release note is updated. Add this label once the release note is updated and removed needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-update-release-note The release note is updated. Add this label once the release note is updated priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT1 One reviewer already commented LGTM type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants