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

Clarify idempotent for ControllerExpandVolume and NodeExpandVolume #397

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

wnxn
Copy link
Contributor

@wnxn wnxn commented Nov 4, 2019

Add explicit documentation for clarity idempotent for
ControllerExpandVolume and NoeExpandVolume

Fixes #396

Signed-off-by: Xin Wang wileywang@yunify.com

@wnxn
Copy link
Contributor Author

wnxn commented Nov 4, 2019

/assign @jdef
PTAL

Copy link
Member

@jdef jdef left a comment

Choose a reason for hiding this comment

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

Please accept the suggested change, and also include a change for NodeExpandVolume that indicates that call is also idempotent (similar to the proposed ControllerExpandVolume change).

spec.md Outdated Show resolved Hide resolved
@jdef
Copy link
Member

jdef commented Nov 4, 2019

Thanks for the PR. If you haven't already signed the CLA for CSI, please do so.

@wnxn
Copy link
Contributor Author

wnxn commented Nov 4, 2019

Thanks for the PR. If you haven't already signed the CLA for CSI, please do so.

Tomorrow, I will ask my colleague about how to sign the CLA for CSI. Please wait a moment.

Copy link
Member

@jdef jdef left a comment

Choose a reason for hiding this comment

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

Thanks. Left last suggestions to fix nits (one sentence per line in .md).

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
@wnxn wnxn changed the title Clarify idempotent for ControllerExpandVolume Clarify idempotent for ControllerExpandVolume and NodeExpandVolume Nov 4, 2019
@wnxn
Copy link
Contributor Author

wnxn commented Nov 5, 2019

Thanks for the PR. If you haven't already signed the CLA for CSI, please do so.

Tomorrow, I will ask my colleague about how to sign the CLA for CSI. Please wait a moment.

Hi @jdef, I signed the CLA for CSI and sent email to container-storage-interface-approvers@googlegroups.com.
Please review this PR again. Thanks.

Copy link
Member

@jdef jdef left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback @gnufied. I made some additional suggestions to clarify. PTAL

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
Add explicit documentation for clarity idempotent for
ControllerExpandVolume and NodeExpandVolume

Signed-off-by: Xin Wang <wileywang@yunify.com>
@wnxn
Copy link
Contributor Author

wnxn commented Nov 5, 2019

Thanks for the feedback @gnufied. I made some additional suggestions to clarify. PTAL

Thanks for @jdef and @gnufied , this PR has been updated.

@gnufied
Copy link
Contributor

gnufied commented Nov 5, 2019

lgtm

Copy link
Member

@jdef jdef left a comment

Choose a reason for hiding this comment

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

LGTM

@jdef
Copy link
Member

jdef commented Nov 6, 2019

@saad-ali @jieyu @julian-hj @ddebroy PTAL

Copy link
Contributor

@julian-hj julian-hj left a comment

Choose a reason for hiding this comment

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

I don't understand the differing usage of MUST and SHOULD here.

If the service returns an error when the volume is already the correct size, wouldn't that make it not idempotent? I guess I am missing the use case where the service ignores the SHOULD but is still idempotent and passes the MUST.

@jdef
Copy link
Member

jdef commented Nov 6, 2019

If the service returns an error when the volume is already the correct size, wouldn't that make it not idempotent?

No ... idempotent has to do w/ the resulting state of the system vs. the error codes returned. Ideally, all plugins would return 0 if the target size has already been achieved.
If a plugin doesn't implement this behavior and returns a non-zero error but otherwise leaves the volume untouched then it's still idempotent, it's just returning a non-recommended RPC status (and so may be sacrificing CO compatibility).

@wnxn
Copy link
Contributor Author

wnxn commented Nov 7, 2019

If the service returns an error when the volume is already the correct size, wouldn't that make it not idempotent?

No ... idempotent has to do w/ the resulting state of the system vs. the error codes returned. Ideally, all plugins would return 0 if the target size has already been achieved.
If a plugin doesn't implement this behavior and returns a non-zero error but otherwise leaves the volume untouched then it's still idempotent, it's just returning a non-recommended RPC status (and so may be sacrificing CO compatibility).

What is the definition of idempotent in our CSI spec?
(1) For the same input, the operation can get the same output.
(2) Operations that have no side-effects if executed multiple times.

In my opinion,
For (1), the first keyword, MUST or SHOULD, should be the same as second keyword.

This operation MUST be idempotent. If a volume corresponding to the specified volume ID is larger than or equal to the capacity requirements after expansion, the plugin MUST reply 0 OK.

This operation SHOULD be idempotent. If a volume corresponding to the specified volume ID is larger than or equal to the capacity requirements after expansion, the plugin SHOULD reply 0 OK.

For (2), for the purpose of backwards compatibility, we can clarify the idempotent same as now.

This operation MUST be idempotent. If a volume corresponding to the specified volume ID is larger than or equal to the capacity requirements after expansion, the plugin SHOULD reply 0 OK.

@julian-hj
Copy link
Contributor

What is the definition of idempotent in our CSI spec?
(1) For the same input, the operation can get the same output.
(2) Operations that have no side-effects if executed multiple times.

Elsewhere in the spec, we've normally observed the first definition. For example: https://github.com/container-storage-interface/spec/blob/master/spec.md#createvolume

Having said that, it seems like the rest of the world's definition of idempotent is converging on what @jdef said. So I'd be fine with that, except that it's a bit inconsistent with other RPCs.

Is there any reason that we need to use SHOULD here? If not, maybe we could just switch it to MUST/MUST in order to keep things consistent any tidy.

@jdef
Copy link
Member

jdef commented Nov 8, 2019 via email

@julian-hj
Copy link
Contributor

julian-hj commented Nov 8, 2019

SHOULD is for backwards compatibility for plugins that might not return 0 OK

Fair enough.

@jdef
Copy link
Member

jdef commented Nov 8, 2019 via email

@gnufied
Copy link
Contributor

gnufied commented Nov 8, 2019

I think so yeah. Do we have a label for csiv2? I can write a github issue.

@jdef jdef merged commit da3002f into container-storage-interface:master Feb 11, 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.

Add idempotent in ControllerExpandVolume
4 participants