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

*: last bound source is prior to other source when pick for bound #1373

Merged
merged 14 commits into from
Jan 23, 2021

Conversation

lance6716
Copy link
Collaborator

@lance6716 lance6716 commented Jan 12, 2021

What problem does this PR solve?

similar to #1044

when DM cluster restarts, worker is not likely keepalive when master goes to below logic, because etcd is in masters

// set the stage as Free if it's keep alive.
if _, ok := kam[name]; ok {
w.ToFree()
// set the stage as Bound and record the bound relationship if exists.
if bound, ok := sbm[name]; ok {
boundsToTrigger = append(boundsToTrigger, bound)
err2 = s.updateStatusForBound(w, bound)
if err2 != nil {
return 0, err2
}
delete(sbm, name)
}
}

so worker is likely bounded to another source rather than its last source.

What is changed and how it works?

we always save a lastBound when do bounding, and not delete it. so when tryBoundForWorker, we could prefer selecting the last bound source for worker.

Also, if user didn't deploy more workers than sources, the bound relationship will not change (I hope)

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has persistent data change

Side effects

Related changes

  • Need to cherry-pick to the release branch

@lance6716
Copy link
Collaborator Author

cc @lichunzhu

@lance6716 lance6716 added this to the v2.0.2 milestone Jan 13, 2021
@lance6716 lance6716 added the status/WIP This PR is still work in progress label Jan 13, 2021
@lance6716 lance6716 added needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels Jan 13, 2021
@lance6716
Copy link
Collaborator Author

PTAL @GMHDBJD @lichunzhu

@GMHDBJD
Copy link
Collaborator

GMHDBJD commented Jan 13, 2021

don't forget to update keyslen

@GMHDBJD
Copy link
Collaborator

GMHDBJD commented Jan 14, 2021

Should we delete last bound info when stop source?

Copy link
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

@GMHDBJD GMHDBJD 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 Jan 18, 2021
@lance6716
Copy link
Collaborator Author

ping @lichunzhu

@lance6716
Copy link
Collaborator Author

PTAL @lichunzhu

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

@lance6716 lance6716 merged commit 673fb1b into pingcap:master Jan 23, 2021
ti-srebot pushed a commit to ti-srebot/dm that referenced this pull request Jan 23, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link

cherry pick to release-2.0 in PR #1397

@ti-srebot ti-srebot added already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Jan 23, 2021
lance6716 pushed a commit that referenced this pull request Jan 23, 2021
@lance6716 lance6716 removed the needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated label Feb 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated status/LGT1 One reviewer already commented LGTM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants