Skip to content

ddl: placement rules in SQL is not compatible with TiFlash #22171

Closed
@xhebox

Description

Bug Report

When PD schedules a partition to tiflash, TiFlash will validate the keyrange if there is a _r suffix.

But placement rules are not compatible with the old set tiflash replica syntax too, so we should forbid using +engine=tiflash, and should add -engine=tiflash to every rule to avoid schedules to tiflash instance.

1. Minimal reproduce step (Required)

  1. tiup playground with at lease 3 tikv instances.

  2. add a random placement rule with the label +engine=tiflash. E.g alter table t alter partition p0 add placement policy role=follower replicas=1 constraints='["+engine=tiflash"]'.

  3. tiup playground with at lease 3 tikv instances.

  4. alter table t set tiflash replica 3

  5. alter table t alter partition p0 add placement policy role=follower replicas=1 constraints='["+engine=tiflash"]'.

2. What did you expect to see? (Required)

The first example should work fine. In the 2nd example, 3 should fail.

3. What did you see instead (Required)

TiFlash crashed.

4. What is your TiDB version? (Required)

Newest nightly.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions