k3s/pkg/controller/volume/attachdetach
Jing Xu efaceb28cc Fix race condition in updating attached volume between master and node
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.
2016-09-12 13:51:08 -07:00
..
cache Fix race condition in updating attached volume between master and node 2016-09-12 13:51:08 -07:00
populator Check pod exist in attach controller DSW populator 2016-07-20 01:03:04 -07:00
reconciler Fix race condition in updating attached volume between master and node 2016-09-12 13:51:08 -07:00
statusupdater node not exist during node status update should not block others 2016-08-18 13:51:30 -07:00
testing Reorganize volume controllers and manager 2016-07-01 18:50:25 -07:00
OWNERS Reorganize volume controllers and manager 2016-07-01 18:50:25 -07:00
attach_detach_controller.go Fix race condition in updating attached volume between master and node 2016-09-12 13:51:08 -07:00
attach_detach_controller_test.go Add Events for operation_executor to show status of mounts, failed or successful 2016-08-17 09:53:47 -04:00