Will the PVC nodes be automatically released when TiCDC scales down horizontally?

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

Original topic: ticdc水平缩容,对应的pvc节点会自动释放吗?

| username: RyanHowe

After mounting the local disk to the deployed TiCDC node and performing horizontal scaling down on TiCDC, it was found that the PVC corresponding to the TiCDC node was not cleaned up. Is this normal? If the corresponding PVC needs to be deleted after scaling down TiCDC, where should the PVC cleanup policy be configured?

| username: songxuecheng | Original post link

By default, PVs are not cleaned up because it is not safe. If you indeed need to clean up after scaling down, you can do it manually.

kubectl patch pv local-pv-c0fee6ea -p '{"spec":{"persistentVolumeReclaimPolicy":"Delete"}}'

Something like this.

| username: RyanHowe | Original post link

Is there any parameter configuration in the operator that can be recycled after setting it?

Currently, I have set pvReclaimPolicy to Delete and enablePVReclaim to true, but it seems not to work well. After setting these two configurations, the PVC of TiFlash can indeed be automatically recycled after the pod is cleaned up, but the PVC of TiCDC cannot be automatically recycled.

| username: songxuecheng | Original post link

It is a global setting. Confirm whether the pod has been reclaimed; it should be reclaimed.

| username: RyanHowe | Original post link

The result I tested here is that when the database instance is deleted or the CDC pod is deleted, the PV corresponding to the PVC of the CDC node is in the “Released” state, but the PV’s reclaim policy is still Retain. The expectation is Deleted!


However, the pvReclaimPolicy set in the tidbcluster.yaml file is Deleted.

| username: yilong | Original post link

You can refer to this, and see if it was initially configured as retain.

| username: RyanHowe | Original post link

Well, thank you. We’ll look into how to configure it so that when we delete CDC, it can also automatically reclaim PV.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.