• 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
.github Loading commit data...
Godeps Loading commit data...
api/swagger-spec Loading commit data...
build Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
contrib Loading commit data...
docs Loading commit data...
examples Loading commit data...
federation Loading commit data...
hack Loading commit data...
hooks Loading commit data...
logo Loading commit data...
pkg Loading commit data...
plugin Loading commit data...
release Loading commit data...
staging Loading commit data...
test Loading commit data...
third_party Loading commit data...
vendor Loading commit data...
www Loading commit data...
.generated_docs Loading commit data...
.gitignore Loading commit data...
CHANGELOG.md Loading commit data...
CONTRIB.md Loading commit data...
CONTRIBUTING.md Loading commit data...
DESIGN.md Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
Makefile.generated_files Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
Vagrantfile Loading commit data...
code-of-conduct.md Loading commit data...
labels.yaml Loading commit data...