-
Notifications
You must be signed in to change notification settings - Fork 288
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
master(dm): specify worker when create upstream source #4167
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Welcome @jerrylisl! |
Hi, do you need some help? we can discuss here or in slack or in asktug |
fbe3fe1
to
0e848f1
Compare
/run-dm-integration-test |
/run-verify |
You can find our CI reports some test is broken with this feature, please take a look at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, please address my comments and fix the git conflict.
t.sourceCfgNotExist(c, s, sourceID2) | ||
t.workerFree(c, s, workerName2) | ||
c.Assert(s.AddSourceCfgWithWorker(&sourceCfg2, workerName1), IsNil) | ||
// source2 is unbound because expected worker1 is already bound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this behaviour is expected. In other words, if user want to add a source to a specific DM-worker, and the worker is not available (offline or already bound), should we bind the source to another worker, left the source unbound or remove the source?
Maybe you need this feature in your scenario, could you explain why you choose this bevaiour?
BTW, when DM-master failover, DM-master will try to bind andany unbound sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specific DM-worker only allow single source, user can do a transfer or remove the source quickly if the specific worker is not available, if we do something like bind the source to another worker (or remove it) can cause some extra "scheduling cost". And i think a "specify-worker" cmd bind a not specific worker may not be expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a "specify-worker" cmd bind a not specific worker may not be expected
I got this.
How about we don't add the source when the specified worker is not available? I can list two reason:
- The command is more atomic, the effects all happen or nothing happen
- When the DM-master failovers, currently we will try to bind any unbound source, so the source may be bound to a unwanted worker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll modify this part and ci later.
d5572cd
to
9d6f538
Compare
/run-dm-integration-test |
@jerrylisl There are some unit test and linters failed, PTAL and feel free to ask for help |
0631eed
to
d1b984d
Compare
i've used "unit_test_pkg" in dm Makefile, is there any substitute in this repository? |
/run-dm-integration-test |
lint error: https://ci.pingcap.net/blue/organizations/jenkins/atom-lint/detail/atom-lint/5808/pipeline/ you can run one integration test fail: https://ci2.pingcap.net/blue/organizations/jenkins/dm_ghpr_integration_test/detail/dm_ghpr_integration_test/2936/pipeline this is because we have a pattern matching for dmctl output, you should also update it
unit test fail: https://ci.pingcap.net/blue/organizations/jenkins/atom-ut/detail/atom-ut/9927/tests/ you can |
also, please sign the CLA #4167 (comment) |
/run-dm-integration-test |
1 similar comment
/run-dm-integration-test |
worker param optional Co-authored-by: lance6716 <[email protected]>
Co-authored-by: lance6716 <[email protected]>
Co-authored-by: lance6716 <[email protected]>
1e72f7e
to
53c0c3b
Compare
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 53c0c3b
|
/run-dm-integration-test |
dm/tests/dmctl_command/run.sh
Outdated
"list-member --name worker1" \ | ||
"\"stage\": \"bound\"" 1 \ | ||
"\"source\": \"mysql-replica-01\"" 1 | ||
dmctl_operate_source create $WORK_DIR/source2.yaml $SOURCE_ID2 -w $WORKER1_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failed,
[2022-01-27T03:23:23.958Z] dmctl test cmd: "operate-source create /tmp/dm_test/dmctl_command/source2.yaml"
[2022-01-27T03:23:25.335Z] dmctl test cmd: "operate-source create /tmp/dm_test/dmctl_command/source2.yaml -w wrong-worker"
[2022-01-27T03:23:25.335Z] dmctl test cmd: "operate-source create /tmp/dm_test/dmctl_command/source2.yaml -w worker1"
[2022-01-27T03:23:25.595Z] dmctl test cmd: "operate-source create /tmp/dm_test/dmctl_command/source2.yaml"
[2022-01-27T03:23:25.595Z] command: operate-source create /tmp/dm_test/dmctl_command/source2.yaml "result": true count: 0 != expected: 2
[2022-01-27T03:23:25.595Z] {
[2022-01-27T03:23:25.595Z] "result": false,
[2022-01-27T03:23:25.595Z] "msg": "[code=46007:class=scheduler:scope=internal:level=medium], Message: source config with ID mysql-replica-02 already exists",
[2022-01-27T03:23:25.595Z] "sources": [
[2022-01-27T03:23:25.595Z] ]
[2022-01-27T03:23:25.595Z] }
for line 89, I think create source2 on worker1 should failed because worker1 is bound to source1, but the script didn't detect the fail until it goes to line 98. Please fix it
/hold |
/run-dm-integration-test |
/run-dm-integration-test |
/unhold |
This pull request has been accepted and is ready to merge. Commit hash: 317dd7d
|
/run-kafka-integration-test |
What problem does this PR solve?
Issue Number: close #4169
command "dmctl operate-source create" add param -w(worker) to specify a DM-worker to be bound.
when using this param, the command can't create multiple source
What is changed and how it works?
1.dmctl parses param "-w(worker)"
2.if the worker is specified, scheduler binds source to it
Check List
Tests
Code changes
Side effects
Related changes
Release note