You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a known issue. Placement rules are cached in memory, persisted in PD. drop table should drop placement rules attached to the table. But you may recover the table later and expect that placement rules will recover, too.
We solve that by delaying the deletion of placement rules, check #20575. But as we don't really drop the persisted rules in PD. TiDB will reload the deleted rules back when:
restart
DDL infoschema fullLoad/snapshot load
Then you met the error mysql root@127.0.0.1:(none)> select * from information_schema.placement_policy (1105, "Can't find partition by id 59")
The full reproduce instructions
# start TiUP and add some rules
mysql root@127.0.0.1:(none)> select * from information_schema.placement_policy
+-------------+-------------+---------+-------------+------------+----------------+------------+--------+----------+-------------------+
| GROUP_ID | GROUP_INDEX | RULE_ID | SCHEMA_NAME | TABLE_NAME | PARTITION_NAME | INDEX_NAME | ROLE | REPLICAS | CONSTRAINTS |
+-------------+-------------+---------+-------------+------------+----------------+------------+--------+----------+-------------------+
| TiDB_DDL_59 | 3 | leader | test | t | p0 | <null> | leader | 1 | "-engine=tiflash" |
| TiDB_DDL_59 | 3 | voter | test | t | p0 | <null> | voter | 3 | "-engine=tiflash" |
+-------------+-------------+---------+-------------+------------+----------------+------------+--------+----------+-------------------+
mysql root@127.0.0.1:(none)> drop table test.t
mysql root@127.0.0.1:(none)> select * from information_schema.placement_policy
+----------+-------------+---------+-------------+------------+----------------+------------+------+----------+-------------+
| GROUP_ID | GROUP_INDEX | RULE_ID | SCHEMA_NAME | TABLE_NAME | PARTITION_NAME | INDEX_NAME | ROLE | REPLICAS | CONSTRAINTS |
+----------+-------------+---------+-------------+------------+----------------+------------+------+----------+-------------+
# restart(scale-in + scale-out) the TiDB node
mysql root@127.0.0.1:(none)> select * from information_schema.placement_policy
(1105, "Can't find partition by id 59")
The text was updated successfully, but these errors were encountered:
Development Task
It is a known issue. Placement rules are cached in memory, persisted in PD.
drop table
should drop placement rules attached to the table. But you may recover the table later and expect that placement rules will recover, too.We solve that by delaying the deletion of placement rules, check #20575. But as we don't really drop the persisted rules in PD. TiDB will reload the deleted rules back when:
Then you met the error
mysql root@127.0.0.1:(none)> select * from information_schema.placement_policy (1105, "Can't find partition by id 59")
The full reproduce instructions
The text was updated successfully, but these errors were encountered: