Skip to content
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

*: make pd module more independent #5189

merged 3 commits into from Aug 5, 2019


Copy link

commented Aug 4, 2019

Signed-off-by: siddontang

What have you changed? (mandatory)

This PR tries to refactor PD module so we can move it to the independent crate later. Now, we do the following changes:

  1. Let Coprocessor and Storage modules don't depend on PD module (IMO, they should not know PD), the two modules only send read flow statistics to PD, so we can extract this to a trait to decouple PD dependency.
  2. Let PD module not depend on raftstore module, the PD module is a base module that the raftstore should depend on it, not reverse. So we move PD task and runner to raftstore worker directly because only raftstore needs these.

Doing this can reduce the compiling time, in my local test with make unportable_release, the partial compiling time reduced from 10m12s to 9m27s.


  1. Move PD module to the independent crate in components.

What are the type of the changes? (mandatory)

  • Engineering (engineering change which doesn't change any feature or fix any issue)

How has this PR been tested? (mandatory)

Passing CI is fine.

Does this PR affect documentation (docs) or release note? (mandatory)


Does this PR affect tidb-ansible update? (mandatory)


siddontang added some commits Aug 4, 2019

*: make pd module more independent
Signed-off-by: siddontang <>
*: remove stale comments code
Signed-off-by: siddontang <>
Merge branch 'master' into siddontang/pd-refactor
Signed-off-by: siddontang <>

This comment has been minimized.

Copy link

commented Aug 5, 2019


@sre-bot sre-bot merged commit 995257d into tikv:master Aug 5, 2019

5 checks passed

DCO All commits are signed off!
idc-jenkins-ci-tikv/integration-common-test Jenkins job succeeded.
idc-jenkins-ci-tikv/integration-compatibility-test Jenkins job succeeded.
idc-jenkins-ci-tikv/integration-ddl-test Jenkins job succeeded.
idc-jenkins-ci/test Jenkins job succeeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.