Skip to content

Refactor VolumeHandle into id and vol attributes #123

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

Merged
merged 2 commits into from
Oct 31, 2017

Conversation

jdef
Copy link
Member

@jdef jdef commented Oct 20, 2017

Fixes #116

@jdef jdef added this to the v0.1 milestone Oct 20, 2017
@jdef jdef requested review from jieyu and saad-ali October 20, 2017 12:46
@jdef
Copy link
Member Author

jdef commented Oct 20, 2017

If/when this lands, let's "rebase and merge" to retain the commit stream

@jdef
Copy link
Member Author

jdef commented Oct 20, 2017

xref #118

@akutz
Copy link
Contributor

akutz commented Oct 20, 2017

Hi @jdef,

I'm not a fan of separating the ID and attributes. I personally like the VolumeHandle you created. If attributes are necessary to perform some type of operation on a Volume, then I think they should be included in the same structure as the ID. The VolumeHandle was perfect for this IMO. The question all along was the necessity of the metadata/attributes. Since they've been deemed necessary I believe they should be part of the VolumeHandle, just not part of the identity. Also, what's wrong with the name Metadata or even Tags? The former is consistent with gRPC naming conventions and the latter is widely used.

@jdef
Copy link
Member Author

jdef commented Oct 21, 2017 via email

@akutz
Copy link
Contributor

akutz commented Oct 21, 2017

When was the follow up meeting? I wasn’t aware it had occurred yet.

csi.proto Outdated
// to volume validation and publishing calls. Attributes MAY NOT
// uniquely identify a volume. A volume uniquely identified by `id`
// SHALL always report the same attributes. This field is REQUIRED.
Attributes attributes = 3;
Copy link
Contributor

@akutz akutz Oct 23, 2017

Choose a reason for hiding this comment

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

Hi @jdef,

It doesn't make sense to me that Attributes should be a discreet message type when it could simply be defined like so:

map<string,string> attributes = 3;

I dislike the trend in this spec to wrap single fields.

Copy link
Member

@jieyu jieyu Oct 23, 2017

Choose a reason for hiding this comment

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

+1

I don't have a strong opinion, but given that parameters is in map<string, string>, i'd prefer to use map<string,string> attributes = 3; here.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, my opinion is strong. I prefer consistency :)

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@jieyu
Copy link
Member

jieyu commented Oct 23, 2017

@saad-ali @julian-hj can you please take a look at this PR? It looks good to me, except for the naming part. But I am fine with any naming.

csi.proto Outdated
// Attributes reflect static properties of a volume and MUST be passed
// to volume validation and publishing calls. Attributes MAY NOT
// uniquely identify a volume. A volume uniquely identified by `id`
// SHALL always report the same attributes. This field is REQUIRED.
Copy link
Contributor

Choose a reason for hiding this comment

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

During the meeting, I think we said that attributes was required to be passed by the CO iff it is returned by the SP. We seem to be losing that nuance in this spec and declaring it as required always. Does that mean that we will always require the SP to return a map, and in the case where the SP doesn't care about parameters, it should just return an empty map? I guess I am OK with that requirement, but just want to make sure we are all on the same page.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @julian-hj,

If it's on the SP to indicate if the data is required it can return an error if an empty map is transmitted, right? If you're just wanting to clarify the spec then I agree it needs to have tighter language.

Copy link
Member

Choose a reason for hiding this comment

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

I think in @jdef's PR, it's a struct Attributes. So it's required to set this field, but the map inside the struct can be empty. If we change this to map<string, string>, we need to clarify in the wording. This field is indeed optional, but if set, the CO should pass that to the subsequent calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jieyu Ah, that makes sense. So we didn't lose the nuance, we just codified it as an optional map inside a required struct. Makes sense. I still think we'd be better off with a plain map & some explicit language about the behavior though.

@julian-hj
Copy link
Contributor

LGTM, with the caveats that I agree with @akutz about the Attributes type being unnecessary, and I think we need to make it clearer that although attributes is required in the CreateVolume response, it is OK for it to be empty.

Copy link
Member

@jieyu jieyu left a comment

Choose a reason for hiding this comment

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

LGTM once the Attributes type is removed in favor of map<string, string> as @julian-hj and @akutz suggested.

@jdef jdef force-pushed the jdef_refactor_metadata branch from dc91b0f to efaface Compare October 26, 2017 22:19
@jdef
Copy link
Member Author

jdef commented Oct 26, 2017

Addressed feedback but left it as a separate commit for easier review. If it looks good, I'll squash it with the prior commit (but NOT squash the whole PR). And we can "rebase and merge" when ready.

// a volume. A volume uniquely identified by `id` SHALL always report
// the same attributes. This field is OPTIONAL and when present MUST
// be passed to volume validation and publishing calls.
map<string,string> attributes = 3;
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we should probably have a limit for the encoded size of this field. 1MiB, or something else?

@akutz
Copy link
Contributor

akutz commented Oct 26, 2017

Lord I regret ever filing #112. I sure liked VolumeHandle for what it was. Oh well. In lieu of that, this LGTM :) Great work @jdef! Thank you for taking this on!

@jdef
Copy link
Member Author

jdef commented Oct 26, 2017

Also, should we have an INVALID_VOLUME_ATTRIBUTES error code for the related RPCs?

@akutz
Copy link
Contributor

akutz commented Oct 26, 2017

Hi @jdef,

I'd be hesitant to add any new errors until @saad-ali completes #18.

This patch updates all references to VolumeHandle so that it is now a
simple string value. Associated field names and error codes have been
updated accordingly.
@jdef jdef force-pushed the jdef_refactor_metadata branch from efaface to 3e75a0d Compare October 31, 2017 11:31
@jdef jdef force-pushed the jdef_refactor_metadata branch from 3e75a0d to 7cb087c Compare October 31, 2017 11:33
@jdef
Copy link
Member Author

jdef commented Oct 31, 2017

ready to "rebase and merge" once CI completes

@jdef jdef merged commit 00095b2 into container-storage-interface:master Oct 31, 2017
@jdef jdef deleted the jdef_refactor_metadata branch October 31, 2017 11:35
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.

4 participants