Error When Using Placement Rules in SQL

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 使用Placement Rules in SQL时报错

| username: terry0219

【TiDB Usage Environment】/Test/ Poc
【TiDB Version】7.5.1
Operations as follows:
mysql> Create placement policy 5policy leader_constraints=“[+availableAZ=cn-beijing-a:2]” follower_constraints=“{+availableAZ=cn-beijing-b: 2,+availableAZ=cn-beijing-c: 1}”;
Query OK, 0 rows affected (0.53 sec)

mysql> alter table test.t1 placement policy 5policy;
ERROR 8243 (HY000): “[PD:placement:ErrRuleContent]invalid rule content, rule ‘table_rule_102_0’ from rule group ‘TiDB_DDL_102’ can not match any store”
What is the reason for this?

| username: terry0219 | Original post link

You can change the writing style to:
CREATE PLACEMENT POLICY 5policy CONSTRAINTS=‘{“+availableAZ=cn-beijing-a”:2, “+availableAZ=cn-beijing-b”:2, “+availableAZ=cn-beijing-c”:1}’;

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.