Skip to content
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

Fix error code on wrong snapshot ID or topology #412

Merged

Conversation

jsafrane
Copy link
Contributor

@jsafrane jsafrane commented Feb 4, 2020

Add one more reason to return ALREADY_EXISTS from CreateVolumeRequest: the volume to be created already exists, but it was restored from a different snapshot than requested

This follows all other ALREADY_EXISTS cases - the volume already exists, but it's something else than CO requested.

@jieyu
Copy link
Member

jieyu commented Feb 5, 2020

This change LGTM. I think we also need to add one more here, which is accessibility_requirements. I.e., the SP should return ALREADY_EXISTS if the CO requested different accessibility_requirements but using the same name. Thoughts?

When CreateVolumeRequest finds out that a volume to be created already
exists and it was restored from a *different* snapshot or is available at
different topology than requested, it should return ALREADY_EXISTS.
@jsafrane
Copy link
Contributor Author

Added accessibility_requirements to the sentence.

@jsafrane jsafrane changed the title Fix error code on wrong snapshot ID Fix error code on wrong snapshot ID or topology Feb 12, 2020
spec.md Outdated
@@ -1119,7 +1119,7 @@ The CO MUST implement the specified error recovery behavior when it encounters t
|-----------|-----------|-------------|-------------------|
| Source incompatible or not supported | 3 INVALID_ARGUMENT | Besides the general cases, this code MUST also be used to indicate when plugin supporting CREATE_DELETE_VOLUME cannot create a volume from the requested source (`SnapshotSource` or `VolumeSource`). Failure MAY be caused by not supporting the source (CO SHOULD NOT have provided that source) or incompatibility between `parameters` from the source and the ones requested for the new volume. More human-readable information SHOULD be provided in the gRPC `status.message` field if the problem is the source. | On source related issues, caller MUST use different parameters, a different source, or no source at all. |
| Source does not exist | 5 NOT_FOUND | Indicates that the specified source does not exist. | Caller MUST verify that the `volume_content_source` is correct, the source is accessible, and has not been deleted before retrying with exponential back off. |
| Volume already exists but is incompatible | 6 ALREADY_EXISTS | Indicates that a volume corresponding to the specified volume `name` already exists but is incompatible with the specified `capacity_range`, `volume_capabilities` or `parameters`. | Caller MUST fix the arguments or use a different `name` before retrying. |
| Volume already exists but is incompatible | 6 ALREADY_EXISTS | Indicates that a volume corresponding to the specified volume `name` already exists but is incompatible with the specified `capacity_range`, `volume_capabilities`, `parameters`, `accessibility_requirements` or `content_source`. | Caller MUST fix the arguments or use a different `name` before retrying. |
Copy link
Contributor

Choose a reason for hiding this comment

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

s/content_source/volume_content_source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@xing-yang
Copy link
Contributor

lgtm

Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@saad-ali saad-ali merged commit 8d138fc into container-storage-interface:master May 27, 2020
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.

5 participants