From eb5806db475ea16562147bcde4b8ff39394de96a Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 22 Apr 2020 13:18:58 +0800 Subject: [PATCH] tiflash: add explanation on how to clear replication rules in pd (#2355) --- reference/tiflash/maintain.md | 45 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/reference/tiflash/maintain.md b/reference/tiflash/maintain.md index 533923e18681e..d24a2874daa0a 100644 --- a/reference/tiflash/maintain.md +++ b/reference/tiflash/maintain.md @@ -58,9 +58,48 @@ Follow the steps below to take a TiFlash node down: > **Note:** > -> If you don't cancel all tables replicated to TiFlash before all TiFlash nodes stop running, you need to manually delete the replication rule in PD. Or you cannot successfully take the TiFlash node down. -> -> To manually delete the replication rule in PD, send the `DELETE` request `http://:/pd/api/v1/config/rule/tiflash/`. `rule_id` refers to the `id` of the `rule` to be deleted. +> If you don't cancel all tables replicated to TiFlash before all TiFlash nodes stop running, you need to manually delete the replication rules in PD. Or you cannot successfully take the TiFlash node down. + +To manually delete the replication rules in PD, take the following steps: + +1. Query all the data replication rules related to TiFlash in the current PD instance: + + {{< copyable "shell-regular" >}} + + ```shell + curl http://:/pd/api/v1/config/rules/group/tiflash + ``` + + ``` + [ + { + "group_id": "tiflash", + "id": "table-45-r", + "override": true, + "start_key": "7480000000000000FF2D5F720000000000FA", + "end_key": "7480000000000000FF2E00000000000000F8", + "role": "learner", + "count": 1, + "label_constraints": [ + { + "key": "engine", + "op": "in", + "values": [ + "tiflash" + ] + } + ] + } + ] + ``` + +2. Delete all the data replication rules related to TiFlash. The following example command deletes the rule whose `id` is `table-45-r`: + + {{< copyable "shell-regular" >}} + + ```shell + curl -v -X DELETE http://:/pd/api/v1/config/rule/tiflash/table-45-r + ``` ## TiFlash troubleshooting