kubernetes-retired / external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Apache License 2.0
2.7k stars 1.6k forks source link

Why is there no leader election scheme for deleting a volume #1343

Closed windayski closed 4 years ago

windayski commented 4 years ago

I looked through the code of ProvisionController. I found there is only one controller could become leader to provision a volume for a given claim. But I am confused that all controllers request to delete volume for one claim. Why is there no leader election scheme for deleting a volume?

wongma7 commented 4 years ago

For provisioning, the fear is that if 2 controllers race then a volume will be leaked. For deleting, if 2 controllers race the end result should still be that the volume is gone.

windayski commented 4 years ago

@wongma7 Thanks for reply. You're right. But it may cause duplicate requests for deleting and sending useless workload to back-end apis.