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
tidb> show placement labels;
+--------+----------------+
| Key | Values |
+--------+----------------+
| disk | ["ssd"] |
| region | ["us-east-1"] |
| zone | ["us-east-1a"] |
+--------+----------------+3 rows inset (0.00 sec)
tidb> CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-east-2";
Query OK, 0 rows affected (0.08 sec)
tidb> CREATE TABLE t1 (a int) PLACEMENT POLICY=p1;
ERROR 1105 (HY000): failed to notify PD the placement rules: "[PD:placement:ErrRuleContent]invalid rule content, rule 'table_rule_58_1' from rule group 'TiDB_DDL_58' can not match any store"
The syntax is correct, but the rule fails because the region does not exist. I propose the following fixes:
We validate PRIMARY_REGION and REGIONS upon creating the placement policy p1 against the list of known values. This won't protect against a race condition that the region could become unavailable in between the policy being created and the table created, so an error could still be returned by PD.
If an error is returned by PD, can we make this easier to understand? Something like "'table_rule_58_1' from rule group 'TiDB_DDL_58' can not match any store. Check to make sure that all stores are online, and the constraints you are specifying are able to be set".
Can we expose DDL_58 in information_schema.placement_rules? A user might be logging these errors and it should be possible to match internal IDs like this, since we can currently map tables to table IDs.
The text was updated successfully, but these errors were encountered:
Consider the following scenario:
The syntax is correct, but the rule fails because the region does not exist. I propose the following fixes:
We validate
PRIMARY_REGION
andREGIONS
upon creating the placement policy p1 against the list of known values. This won't protect against a race condition that the region could become unavailable in between the policy being created and the table created, so an error could still be returned by PD.If an error is returned by PD, can we make this easier to understand? Something like "'table_rule_58_1' from rule group 'TiDB_DDL_58' can not match any store. Check to make sure that all stores are online, and the constraints you are specifying are able to be set".
Can we expose DDL_58 in
information_schema.placement_rules
? A user might be logging these errors and it should be possible to match internal IDs like this, since we can currently map tables to table IDs.The text was updated successfully, but these errors were encountered: