store delete <store-id>,tikv节点无法下线

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:tidb 4.0.8 ,operator v1.1.8
  • 【问题描述】:模拟故障场景,手动删除pv,pvc ,pod,tikv-pod重建后无法加入集群。
kubectl get pod -n liuxiao 
NAME                                      READY   STATUS             RESTARTS   AGE
tidb-liuxiao-discovery-7c6dc8b946-jgvcs   1/1     Running            0          3d23h
tidb-liuxiao-monitor-6f7dbbbbbb-wk8vq     3/3     Running            0          14d
tidb-liuxiao-pd-0                         1/1     Running            0          10d
tidb-liuxiao-pd-1                         1/1     Running            0          13d
tidb-liuxiao-pd-2                         1/1     Running            0          13d
tidb-liuxiao-tidb-0                       2/2     Running            0          14d
tidb-liuxiao-tikv-0                       0/1     CrashLoopBackOff   5          4m8s
tidb-liuxiao-tikv-1                       1/1     Running            0          29h
tidb-liuxiao-tikv-2                       1/1     Running            0          29h

查看pod的日志提示duplicated store address: id:4205 address:"tidb-liuxiao-tikv-0.tidb-liuxiao-tikv-peer.liuxiao.svc:20160"

这是登录pd的pod,执行store delete,对应的store还是不能下线

» store delete 1
Success!
» store  1
{
  "store": {
    "id": 1,
    "address": "tidb-liuxiao-tikv-0.tidb-liuxiao-tikv-peer.liuxiao.svc:20160",
    "state": 1,
    "labels": [
      {
        "key": "failure-domain.beta.kubernetes.io/zone",
        "value": "cn-north-1"
      },
      {
        "key": "kubernetes.io/hostname",
        "value": "10.226.132.105"
      }
    ],
    "version": "4.0.8",
    "status_address": "tidb-liuxiao-tikv-0.tidb-liuxiao-tikv-peer.liuxiao.svc:20180",
    "git_hash": "83091173e960e5a0f5f417e921a0801d2f6635ae",
    "start_timestamp": 1610002353,
    "deploy_path": "/",
    "last_heartbeat": 1611219947306883817,
    "state_name": "Offline"
  },
  "status": {
    "capacity": "1.432TiB",
    "available": "1.427TiB",
    "used_size": "1.465GiB",
    "leader_count": 0,
    "leader_weight": 1,
    "leader_score": 0,
    "leader_size": 0,
    "region_count": 44,
    "region_weight": 1,
    "region_score": 1603,
    "region_size": 1603,
    "start_ts": "2021-01-07T06:52:33Z",
    "last_heartbeat_ts": "2021-01-21T09:05:47.306883817Z",
    "uptime": "338h13m14.306883817s"
  }
}

具体步骤可以上传下吗? 是所有pod的pvc,pv 这些都删除了,还是这一个 tikv pod的信息

只是删除了一个pvc,
具体步骤如下:
1、kubectl delete pv (卡住,Ctrl+C ,退出)
2、kubectl delete pvc (卡住 ,Ctrl+C ,退出)
3、kubectl delete pod
pod删除后,会重建pod,pvc ,pv ,然后就出现上述情况,你看能否复现。

  1. 麻烦 edit tc 看一下当前 tikv store 的状态 。 kubectl edit tc -n xx 查看最后 tikv 当前的状态
  2. kubectl describe pod 日志除了 duplicate 的报错还有其他的吗? 麻烦多上传一些。
  3. 用pd-ctl 查看下当前 store 状态