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

dm-worker: support election with same source-id #399

Closed
wants to merge 6 commits into from

Conversation

WangXiangUSTC
Copy link
Contributor

What problem does this PR solve?

support election with the same source-id for dm-worker

What is changed and how it works?

  1. add dm-masters' address config for dm-worker
  2. use pkg/election to election leader on source-id

Check List

Tests

  • Unit test

@WangXiangUSTC WangXiangUSTC added status/PTAL This PR is ready for review. Add this label back after committing new changes type/feature New feature labels Dec 4, 2019
@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

@WangXiangUSTC WangXiangUSTC added status/WIP This PR is still work in progress and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Dec 4, 2019
@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

1 similar comment
@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

@WangXiangUSTC WangXiangUSTC added 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 Dec 5, 2019
etcdClient *etcd.Client
election *election.Election

name string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

useless, I will remove this line next commit

@@ -242,7 +242,7 @@ func (c *Config) adjust() error {
if err != nil {
return terror.ErrMasterGetHostnameFail.Delegate(err)
}
c.Name = fmt.Sprintf("%s-%s", defaultNamePrefix, hostname)
c.Name = fmt.Sprintf("%s-%s-%s", defaultNamePrefix, hostname, port)
Copy link
Member

Choose a reason for hiding this comment

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

👍

@csuzhangxc csuzhangxc mentioned this pull request Dec 6, 2019
23 tasks
@WangXiangUSTC WangXiangUSTC deleted the xiang/worker_election branch January 9, 2020 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/PTAL This PR is ready for review. Add this label back after committing new changes type/feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants