From e18c00cd8e5c0fb4b1c0762e9ae0345ddf23307b Mon Sep 17 00:00:00 2001 From: Ran Date: Tue, 21 Apr 2020 13:51:22 +0800 Subject: [PATCH 1/2] tiflash: add explanation on how to clear replication rules in pd --- 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..b3fffbf73ce93 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 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 From 020b650a83b3796711ba9b46ab558d08d31b8ba3 Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 22 Apr 2020 11:31:08 +0800 Subject: [PATCH 2/2] Update reference/tiflash/maintain.md Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com> --- reference/tiflash/maintain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tiflash/maintain.md b/reference/tiflash/maintain.md index b3fffbf73ce93..d24a2874daa0a 100644 --- a/reference/tiflash/maintain.md +++ b/reference/tiflash/maintain.md @@ -93,7 +93,7 @@ To manually delete the replication rules in PD, take the following steps: ] ``` -2. Delete all the data replication rules related to TiFlash. The following command deletes the rule whose `id` is `table-45-r`: +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" >}}