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

Refactor worker for high available DM #424

Merged
merged 26 commits into from
Dec 20, 2019

Conversation

Little-Wallace
Copy link
Contributor

@Little-Wallace Little-Wallace commented Dec 12, 2019

What problem does this PR solve?

Make master manage the config of mysql.

Check List

Tests

  • Unit test

Code changes

  • master: If you want to start some task which would subscribe data from mysql, you must create a mysql task in master at first.
func OperateMysqlWorker(WorkerConfigRequest)WorkerConfigResponse // create mysql relay log worker / update mysql config / stop mysql worker.
  • worker: If you want worker to do some task which sync data from mysql to TiDB, you must start a mysql task in this server at first.

Side effects

  • Possible performance regression
  • Increased code complexity

Related changes

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
dm/master/coordinator/worker.go Outdated Show resolved Hide resolved
dm/proto/dmworker.proto Outdated Show resolved Hide resolved
dm/proto/dmworker.proto Outdated Show resolved Hide resolved
s.Unlock()
shouldStop = false
} else {
// Try to connect master again before stop worker
Copy link
Member

Choose a reason for hiding this comment

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

Are TODO for this line and L110?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? This gorutine will keep trying KeepAlive util it receives a signal which set 'shouldExit' true.

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
@Little-Wallace Little-Wallace merged commit 7b64b8e into pingcap:ha-dev Dec 20, 2019
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
* refactor worker

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants