-
Notifications
You must be signed in to change notification settings - Fork 188
mydumper: generate tables needed to dump for mydumper automatically (#310) #326
mydumper: generate tables needed to dump for mydumper automatically (#310) #326
Conversation
…check whether we should generate tables args or not
please fix this cherry pick @lichunzhu |
Codecov Report
@@ Coverage Diff @@
## release-1.0 #326 +/- ##
==============================================
Coverage 59.9455% 59.9455%
==============================================
Files 135 135
Lines 15047 15047
==============================================
Hits 9020 9020
Misses 5151 5151
Partials 876 876 |
@@ -161,7 +162,8 @@ func (t *testServer) TestTaskAutoResume(c *C) { | |||
// start task | |||
cli := t.createClient(c, fmt.Sprintf("127.0.0.1:%d", port)) | |||
subtaskCfgBytes, err := ioutil.ReadFile("./subtask.toml") | |||
_, err = cli.StartSubTask(context.Background(), &pb.StartSubTaskRequest{Task: string(subtaskCfgBytes)}) | |||
// strings.Replace is used here to uncomment extra-args to avoid mydumper connecting to DB and generating arg --tables-list which will cause failure |
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.
is it the only way to handle this problem? it's tricky
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.
Yes, I admit that. Perhaps we can add failpoint to solve this problem?
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.
LGTM
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.
LGTM
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
cherry-pick #310 to release-1.0
What problem does this PR solve?
Now users need to add
extra-args
formydumper
to help it decide tables needed to dump. When the situations are very complicated it's very hard for users to do that. This PR aims to generate the tables needed to be dumped automatically so that we can simplify the configuration process.What is changed and how it works?
Generate mydumper
extra-args
through black-white list and router rules when it is empty. Before start mydumper will connect toDB
to fetch all the tables from database, filter useful tables and generateextra-args
in--tables-list db1.tb1,db2.tb2..
format.A unit-test is added to test whether it can generate right args when
extra-args
is empty. For integration_tests except "start_task" I expurge theextra-args
to test whether it can run correctly.Check List
Tests
Related changes