Skip to content

Add reason to ControllerUnpublishVolumeRequest - #613

Open
torredil wants to merge 1 commit into
container-storage-interface:masterfrom
torredil:cs-610
Open

torredil wants to merge 1 commit into
container-storage-interface:masterfrom
torredil:cs-610

Conversation

@torredil

Copy link
Copy Markdown

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR adds an optional reason field to ControllerUnpublishVolumeRequest that lets COs give SPs more context about out of sequence ControllerUnpublishVolume calls.

Which issue(s) this PR fixes:

Fixes #610

Does this PR introduce an API-breaking change?:

NONE.

Signed-off-by: Eddie Torres <torredil@amazon.com>
@torredil

Copy link
Copy Markdown
Author

cc: @bswartz @gnufied PTAL, thanks!

@huww98

huww98 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

How do you plan to implement this in external-attacher? Do we add a new field to VolumeAttachment?

Comment thread csi.proto
Comment on lines +885 to +889
// The CO has taken the node out of service after determining that
// the node is shut down or otherwise unable to access the volume.
// The CO MUST NOT use this value solely because the node is
// unreachable or a timeout has expired.
NODE_OUT_OF_SERVICE = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the crucial information here is that the CO is offering a guarantee to the SP that the node is dead, which the SP can rely on. Of course that promise can be violated, but if so it's the CO's fault. I propose this language:

// The CO is asserting that the node is either permanently
// removed from the cluster, powered down, or rebooting.
// This reason MUST NOT be used if it is possible that the node
// may retain any open connection to the volume such that
// stale cached reads or stale cached writes to the volume
// could occur from the node.

Comment thread csi.proto
Comment on lines +878 to +882
// The CO stopped waiting for `NodeUnstageVolume` and
// `NodeUnpublishVolume` to succeed, for example because a timeout
// expired or the node is unreachable, and has not taken the node
// out of service. The node might still be able to access the
// volume.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to add language here discouraging COs from using this reason, since up to know we've said this behavior is spec violating. I propose this language:

// The CO stopped waiting for NodeUnstageVolume and
// NodeUnpublishVolume to succeed, for example because the node
// is unreachable and a timeout expired. The CO makes no guarantees
// about whether the node can still access the volume and the node
// MAY retain cached state which could result in stale reads or stale
// writes if the SP does not take precautions to prevent improper or
// corrupted I/O.
// This reason is inherently dangerous and COs SHOULD NOT use it.
// It is included here to allow SPs to know that the CO is doing something
// dangerous in the case when the CO can't avoid it.

Comment thread csi.proto
}
message ControllerUnpublishVolumeRequest {
enum Reason {
UNKNOWN = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a 4th reason -- one that indicates that the CO thinks all NodeUnstage requests have succeeded. Remember that the reason field will always be present, even on the happy path.

Comment thread csi.proto
Comment on lines +909 to +914
// Indicates why the CO is calling `ControllerUnpublishVolume`
// before all `NodeUnstageVolume` and `NodeUnpublishVolume` calls
// on the volume have succeeded. The SP MAY use this information
// when deciding how to unpublish the volume.
// This field is OPTIONAL. The CO MUST NOT set this field if
// `node_id` is unset.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reworded to encompass the happy path case. The CO will still populate this field with a value even when NodeUnstageVolume and NodeUnpublishVolume have succeeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signal node-out-of-service state in ControllerUnpublishVolume

3 participants