• Jing Xu's avatar
    Fix race condition in updating attached volume between master and node · efaceb28
    Jing Xu authored
    This PR tries to fix issue #29324. This cause of this issue is a race
    condition happens when marking volumes as attached for node status. This
    PR tries to clean up the logic of when and where to mark volumes as
    attached/detached. Basically the workflow as follows,
    1. When volume is attached sucessfully, the volume and node info is
    added into nodesToUpdateStatusFor to mark the volume as attached to the
    node.
    2. When detach request comes in, it will check whether it is safe to
    detach now. If the check passes, remove the volume from volumesToReportAsAttached
    to indicate the volume is no longer considered as attached now.
    Afterwards, reconciler tries to update node status and trigger detach
    operation. If any of these operation fails, the volume is added back to
    the volumesToReportAsAttached list showing that it is still attached.
    
    These steps should make sure that kubelet get the right (might be
    outdated) information about which volume is attached or not. It also
    garantees that if detach operation is pending, kubelet should not
    trigger any mount operations.
    efaceb28
Name
Last commit
Last update
..
admission Loading commit data...
api Loading commit data...
apimachinery Loading commit data...
apis Loading commit data...
apiserver Loading commit data...
auth Loading commit data...
capabilities Loading commit data...
client Loading commit data...
cloudprovider Loading commit data...
controller Loading commit data...
conversion Loading commit data...
credentialprovider Loading commit data...
dns Loading commit data...
fieldpath Loading commit data...
fields Loading commit data...
genericapiserver Loading commit data...
healthz Loading commit data...
httplog Loading commit data...
hyperkube Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
labels Loading commit data...
master Loading commit data...
metrics Loading commit data...
probe Loading commit data...
proxy Loading commit data...
quota Loading commit data...
registry Loading commit data...
runtime Loading commit data...
security Loading commit data...
securitycontext Loading commit data...
selection Loading commit data...
serviceaccount Loading commit data...
ssh Loading commit data...
storage Loading commit data...
types Loading commit data...
ui Loading commit data...
util Loading commit data...
version Loading commit data...
volume Loading commit data...
watch Loading commit data...
OWNERS Loading commit data...