-
Notifications
You must be signed in to change notification settings - Fork 378
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
Refactor VolumeHandle into id and vol attributes #123
Conversation
If/when this lands, let's "rebase and merge" to retain the commit stream |
xref #118 |
Hi @jdef, I'm not a fan of separating the ID and attributes. I personally like the |
There was a follow up community meeting where the fate of metadata was
decided. Basically, it shouldn't contain sensitive data and wasn't
necessary for all calls. I renamed it because I thought it would bring
clarity of purpose.
Let the bikeshedding on naming begin! :)
…On Oct 20, 2017 12:07 PM, "Schley Andrew Kutz" ***@***.***> wrote:
Hi @jdef <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPVLAO6k-5dL46JO6XNyl8jZL2Fpb5Fks5suMSugaJpZM4QAnpQ>
.
|
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
LGTM, with the caveats that I agree with @akutz about the |
There was a problem hiding this 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.
dc91b0f
to
efaface
Compare
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; |
There was a problem hiding this comment.
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?
Also, should we have an INVALID_VOLUME_ATTRIBUTES error code for the related RPCs? |
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.
efaface
to
3e75a0d
Compare
3e75a0d
to
7cb087c
Compare
ready to "rebase and merge" once CI completes |
VolumeHandle
changes from spec: Update VolumeHandle & NodeID to simple string values #117 (thanks @akutz!), which eliminatesmetadata
and defines the unique volume identifier as a stringid
.attributes
for aVolumeInfo
and passes them through to publish and validation requests.Fixes #116