Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: ticdc水平缩容,对应的pvc节点会自动释放吗?
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?
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.
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.
It is a global setting. Confirm whether the pod has been reclaimed; it should be reclaimed.
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.
You can refer to this, and see if it was initially configured as retain.
Well, thank you. We’ll look into how to configure it so that when we delete CDC, it can also automatically reclaim PV.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.