pingcap / pingcap/tidb-operator

ticdc: pvc_cleaner doesn't reclaim PVC after ticdc scaled in

Open
#4,943 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.3k
Forks
540
Avg merge
3d 2h
Merged PRs (30d)
18

Description

Bug Report

https://github.com/pingcap/tidb-operator/blob/b004b9aa02197d7198d7fa44c5fee3958dd07dd6/pkg/manager/member/pvc_cleaner.go#L71-L103

What did you do?

Create a tidb-cluster with 3 ticdc replicas, then scale in 1 replicas

What did you expect to see?

Only 1 ticdc data pvc left.

In our k8s environment, the storageclass we use is extremely valuable. Each node has only 2-3 PVs created, yet we run hundreds of TiDB clusters for testing purposes. Therefore, it is imperative that scaled-in PVs are reclaimed as soon as possible.

What did you see instead?

ticdc-data-tc-ticdc-0      Bound    pvc-8d6d669a-c631-40da-9c14-dd108825b331   500Gi      RWO            local-path     11m
ticdc-data-tc-ticdc-1      Bound    pvc-53e1eeee-bab5-4d48-a3a9-ab91fb4c4111   500Gi      RWO            local-path     11m
ticdc-data-tc-ticdc-2      Bound    pvc-e61a2b51-7b71-421b-820a-81ae2d2e20fb   500Gi      RWO            local-path     11m

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/manager/member/pvc_cleaner.go at the linked lines and reproduce the reported scale-in from 3 TiCDC replicas to 2. Trace why the scaled-in PVC remains and verify the cleanup behavior against the expected state: only the remaining TiCDC data PVCs should be left.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.