volume may leak when PVC is deleted before return from CreateVolume #4281
-
Describe the bugIf PVCs are created and deleted immediately, the volume may leak on rare occasions. This problem occurs especially when a large number of PVCs are created and deleted repeatedly at the same time. From our survey, it seems that the external provisioner finishes the process without calling DeleteVolume if the PVC is deleted before the PV is created after the CSI driver's CreateVolume is called. Therefore, ceph-csi may have continued the CreateVolume process and allocated the volume, and then DeleteVolume was not called, and a leak may have occurred. This behavior cannot be solved by fixing ceph-csi alone, but I report it as what we could actually observe. Environment details
Steps to reproduce
Actual resultsThe attached logs can be obtained. In our environment, we found more than 900 volumes. However, this is the result of over a year of creating and deleting more than 100 PVCs per minute. Expected behaviorThe volume is deleted or PV should remain until the volume is deleted. And need a way to clean up the leaked volumes. LogsIt reports the logs and timestamps checked for the following records.
The stat of the volume.
The log of the provisioner.
I looked for the log to know the accurate timestamps of creating and deleting PVC, but I couldn't find it. The following is a logs of events get from the api server.
Additional contextrelated issue in extra provisioner: kubernetes-csi/external-provisioner#486 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes this a known issue, |
Beta Was this translation helpful? Give feedback.
Yes this a known issue,
Nothing can be done from CephCSI side.
It needs to be handled in external-provisioner sidecar.