Issues with the `curl -X DELETE` PD API

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

Original topic: curl -X DELETE pd api问题

| username: 路在何chu

[TiDB Usage Environment] Production Environment
6.5
[Reproduction Path] What operations were performed to cause the issue
Accidentally deleted a TiKV node, forcibly took it offline on the original server, and then brought it back online
[Encountered Issue: Problem Description and Impact]
Does anyone know where this API comes from http://xxx3:2379/pd/api/v1/store/84?force=true? I can’t find it on the official website.

| username: TiDBer_jYQINSnf | Original post link

What are you going to do? This delete force=true is suitable for use when marking TiKV as offline directly after physically deleting TiKV.

| username: tidb菜鸟一只 | Original post link

In the older version, you could operate PD through the API without using TiUP. Now, you can just use TiUP directly.

| username: Jasper | Original post link

You can look here: Placement Driver API API documentation

| username: Jasper | Original post link

In fact, it is also written on the official website: TiDB 集群监控 API | PingCAP 文档中心

| username: dba远航 | Original post link

He is probably trying to use this to forcibly take the TiKV offline.

| username: 路在何chu | Original post link

I used this to forcibly delete the PD store information, otherwise, it couldn’t be expanded.

| username: 路在何chu | Original post link

If you don’t execute this, it will report an error: » store delete 203084
Failed to delete store 203084: [400] “[PD:core:ErrStoresNotEnough]cannot remove store 203084 since the number of up stores would be 2 while need 3”

| username: TiDBer_jYQINSnf | Original post link

This deletion is risky. If multiple deletions occur, it may result in the loss of the majority of replicas in some regions.

| username: TiDBer_jYQINSnf | Original post link

Why do you want to do this? Turning 3 into 2?

| username: 路在何chu | Original post link

The data directory of the deleted node has been cleared, so it can only be forcibly taken offline.

| username: 路在何chu | Original post link

Misoperation.

| username: 路在何chu | Original post link

This parameter cannot be modified using pd-ctl, right?

| username: TiDBer_jYQINSnf | Original post link

Just execute it, and after execution, the TiKV started by that node can be used. Wait until the replicas are replenished before performing other operations.

| username: 路在何chu | Original post link

Yes, that’s right.

| username: system | Original post link

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