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

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

csuzhangxc
Copy link
Member

@csuzhangxc csuzhangxc commented Mar 17, 2020

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

@csuzhangxc csuzhangxc added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes type/bug-fix Bug fix needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Mar 17, 2020
@csuzhangxc
Copy link
Member Author

@WangXiangUSTC @lichunzhu PTAL

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@478e6c6). Click here to learn what that means.
The diff coverage is 72.2222%.

@@             Coverage Diff             @@
##             master       #552   +/-   ##
===========================================
  Coverage          ?   56.7681%           
===========================================
  Files             ?        183           
  Lines             ?      18949           
  Branches          ?          0           
===========================================
  Hits              ?      10757           
  Misses            ?       7106           
  Partials          ?       1086

@csuzhangxc csuzhangxc added this to the v1.0.5 milestone Mar 17, 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

@lichunzhu lichunzhu added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes 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/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Mar 18, 2020
@csuzhangxc csuzhangxc merged commit 4f6c54b into pingcap:master Mar 18, 2020
@csuzhangxc csuzhangxc deleted the fix-loader-checkpoint branch March 18, 2020 02:06
@sre-bot
Copy link

sre-bot commented Mar 18, 2020

cherry pick to release-1.0 in PR #554

@sre-bot sre-bot added already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 labels Mar 18, 2020
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 7, 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-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked 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/LGT2 Two reviewers already commented LGTM, ready for merge type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate entry when loading load
4 participants