Skip to content

ddl: Move TiFlash cluster manager module into TiDB #29924

@CalvinNeo

Description

@CalvinNeo

Enhancement

Currently, TiDB server cooperates with TiFlash cluster manager when adding TiFlash replica for tables. This strategy has many drawbacks:

  1. The whole process is driven by TiFlash cluster manager, which executes at long intervals. It takes a long time from set tiflash replica ddl to TiFlash replica is available, especially when there are lots of small temporary tables.
  2. TiFlash cluster manager need to pull all pd rules from pd server, pull all table infos from TiDB, and report sync status to every TiDB server, which costs lots of traffic.
  3. TiFlash cluster manager communicate by etcd, which is not a good practice
  4. For blocked ddl add partition, TiDB may create an unnecessary ddl job.

Therefore, we decide to move TiFlash cluster manager into TiDB server:

  1. TiDB now pull TiFlash's sync status directly in a status polling loop, instead of waiting for messages from TiFlash cluster manager.
  2. TiDB now set placement rule while executing ddl, instead of fetching, comparing and setting pd rules in status polling loop.
  3. Use ddl owner manager to manage leadership, instead of etcd in TiFlash cluster manager.
  4. Fix blocked ddl add partition problem.

This issue will be fixed in PR #29909

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions