Skip to content

Commit 4ac2d13

Browse files
committed
spec: Clarify calling multiple NodePublishVolume
Clarifies that `NodePublishVolume` can only be called multiple times on a node for a volume if that volume can be published on multiple nodes (i.e., has MULTI_NODE capability). If a volume cannot be published on multiple node, it's weird that we allow it to be publish multiple times on a single node. In other words, it's weird that we allow two workloads to share a volume if they are on the same node, but don't have a way to do that if they are on different nodes.
1 parent a7d7e08 commit 4ac2d13

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

csi.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,12 @@ message VolumeCapability {
187187
enum Mode {
188188
UNKNOWN = 0;
189189

190-
// Can be published as read/write at one node at a time.
190+
// Can only be published once as read/write on a single node, at
191+
// any given time.
191192
SINGLE_NODE_WRITER = 1;
192193

193-
// Can be published as readonly at one node at a time.
194+
// Can only be published once as readonly on a single node, at
195+
// any given time.
194196
SINGLE_NODE_READER_ONLY = 2;
195197

196198
// Can be published as readonly at multiple nodes simultaneously.

lib/go/csi/csi.pb.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,12 @@ message VolumeCapability {
523523
enum Mode {
524524
UNKNOWN = 0;
525525
526-
// Can be published as read/write at one node at a time.
526+
// Can only be published once as read/write on a single node, at
527+
// any given time.
527528
SINGLE_NODE_WRITER = 1;
528529
529-
// Can be published as readonly at one node at a time.
530+
// Can only be published once as readonly on a single node, at
531+
// any given time.
530532
SINGLE_NODE_READER_ONLY = 2;
531533
532534
// Can be published as readonly at multiple nodes simultaneously.
@@ -1016,12 +1018,22 @@ It is NOT REQUIRED for a controller plugin to implement the `LIST_VOLUMES` capab
10161018

10171019
This RPC is called by the CO when a workload that wants to use the specified volume is placed (scheduled) on a node.
10181020
The Plugin SHALL assume that this RPC will be executed on the node where the volume will be used.
1019-
This RPC MAY be called by the CO multiple times on the same node for the same volume with possibly different `target_path` and/or auth credentials.
1021+
10201022
If the corresponding Controller Plugin has `PUBLISH_UNPUBLISH_VOLUME` controller capability, the CO MUST guarantee that this RPC is called after `ControllerPublishVolume` is called for the given volume on the given node and returns a success.
10211023

10221024
This operation MUST be idempotent.
10231025
If this RPC failed, or the CO does not know if it failed or not, it MAY choose to call `NodePublishVolume` again, or choose to call `NodeUnpublishVolume`.
10241026

1027+
This RPC MAY be called by the CO multiple times on the same node for the same volume with possibly different `target_path` and/or auth credentials if the volume has MULTI_NODE capability (i.e., `access_mode` is either `MULTI_NODE_READER_ONLY`, `MULTI_NODE_SINGLE_WRITER` or `MULTI_NODE_MULTI_WRITER`).
1028+
The following table shows what the Plugin SHOULD return when receiving a second `NodePublishVolume` on the same volume on the same node:
1029+
1030+
| | T1=T2, C1=C2 | T1=T2, C1!=C2 | T1!=T2, C1=C2 | T1!=T2, C1!=C2 |
1031+
|----------------|-----------------|---------------|---------------|----------------|
1032+
| MULTI_NODE | OK (idempotent) | ABORTED | OK | OK |
1033+
| Non MULTI_NODE | OK (idempotent) | ABORTED | ABORTED | ABORTED |
1034+
1035+
(`Tn`: target path of the n-th `NodePublishVolume`, `Cn`: credential of the n-th `NodePublishVolume`)
1036+
10251037
```protobuf
10261038
message NodePublishVolumeRequest {
10271039
// The API version assumed by the CO. This is a REQUIRED field.
@@ -1085,6 +1097,8 @@ Condition | gRPC Code | Description | Recovery Behavior
10851097
| --- | --- | --- | --- |
10861098
| Volume does not exists | 5 NOT_FOUND | Indicates that a volume corresponding to the specified `volume_id` does not exist. | Caller MUST verify that the `volume_id` is correct and that the volume is accessible and has not been deleted before retrying with exponential back off. |
10871099
| Operation pending for volume | 9 FAILED_PRECONDITION | Indicates that there is a already an operation pending for the specified volume. In general the Cluster Orchestrator (CO) is responsible for ensuring that there is no more than one call "in-flight" per volume at a given time. However, in some circumstances, the CO MAY lose state (for example when the CO crashes and restarts), and MAY issue multiple calls simultaneously for the same volume. The Plugin, SHOULD handle this as gracefully as possible, and MAY return this error code to reject secondary calls. | Caller SHOULD ensure that there are no other calls pending for the specified volume, and then retry with exponential back off. |
1100+
| Exceeds capabilities | 10 ABORTED | Indicates that the CO has exceeded the volume's capabilities because the volume does not have MULTI_NODE capability. | Caller MAY retry at a higher-level by calling `ValidateVolumeCapabilities` to validate the volume capabilities, or wait for the volume to be unpublished on the node. |
1101+
10881102

10891103
#### `NodeUnpublishVolume`
10901104

0 commit comments

Comments
 (0)