-
Notifications
You must be signed in to change notification settings - Fork 39.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttachDisk should not call detach inside of Cinder volume provider #50042
Conversation
This PR fixes kubernetes#50038 which removes the detach call inside of AttachDisk.
return "", err | ||
} | ||
errmsg := fmt.Sprintf("Disk %s is attached to a different instance (%s)", volumeID, volume.AttachedServerId) | ||
glog.V(2).Infof(errmsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we preserve/log the original error too? something like
glog.V(2).Infof("%s : %s", errmsg, err.Error())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep the log message with glog.V(2).Infof(errmsg) right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. never mind, i read this wrong, i think i was thinking about the err from DetachDisk and you have already removed that call :)
/retest |
I do not fully agree with this PR. We had lots of problems without this detachdisk. If you delete this detachdisk from code, it means that if you have pod running in server1, server1 is shutdowned -> the pod cannot move to server2 without someone going and release the drive manually please test it carefully before removing things like this. In bad case you are breaking someone production because the failover does not work anymore like it worked before. |
/approve cancel |
Let's get @anguslees 's opinion here too |
@zetaab shouldn't the attach/detach controller in the controller manager be handling detach logic? I'm confused why you have to manually detach. Are you running an older version of the control plane? |
well we have 1.7, but i have not tested it without that detachdisk line. We have another environment which is using openshift 3.5 (kubernetes 1.5) and we have to detach drives manually once in a week. Anyways I would say that another pr made by @jamiehannaford looks better than just removing this line(how well it is tested?). |
The logic of AttachDisk in all other attachable volume plugins (e.g., GCE PD, AWS EBS) is that if it is already attached to a different instance, it just returns error. Kubernetes attach_detach controller decides when is safe to detach and takes the action. Before detaching, we have to make sure the the volume is already unmounted, otherwise it will cause data corruption. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, jingxu97 Associated issue: 50038 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/release-note-none |
Dang it! we need someone to clear the "do-not-merge" label :( |
@dims Just wondering, how does that usually work? Do we need to ping someone? |
/retest |
Automatic merge from submit-queue (batch tested with PRs 50087, 39587, 50042, 50241, 49914) |
@wojtek-t can this be cherry-picked for v1.7.4? |
Removing label |
@jingxu97 @jamiehannaford - if you want this to be cherrypicked, please provide a release note |
SGTM |
When do the volume attach and find the volume had been attached to another node, is it better to to check whether the volume should be detached or not? then we can decide to detach the volume or just return error. The previous code is just do detach in this situation and now this PR changed to not do the detach. If we can check the volume should be detached or not, that would be better and can solve many issues like |
@wenlxie What do you mean? Usually this is handled by the attach/detach controller, right? |
Cherrypick approved and created. |
Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
Automatic merge from submit-queue (batch tested with PRs 50087, 39587, 50042, 50241, 49914) AttachDisk should not call detach inside of Cinder volume provider
This PR fixes #50038 which removes the detach call inside of AttachDisk.