> On July 20, 2017, 1:27 a.m., Qian Zhang wrote:
> > include/mesos/v1/mesos.proto
> > Lines 2815 (patched)
> > <https://reviews.apache.org/r/60932/diff/2/?file=1780158#file1780158line2815>
> >
> >     Why do we need this? I see `Entry.op` is a required field rather than 
> > an optional field, so why do we need `UNKNOWN` for a required field?
> 
> Gilbert Song wrote:
>     We will use `UNKNOWN` in all protobuf enums:
>     https://issues.apache.org/jira/browse/MESOS-4997
> 
> Qian Zhang wrote:
>     Yeah, I saw that. But that is for backwards compatibility, and the 
> solution mentioned in that ticket is `use optional enum fields and include an 
> UNKNOWN value as the first entry in the enum`, but in this patch, the enum 
> field `Entry.op` is required.
> 
> Qian Zhang wrote:
>     In the latest patch, I see you have made `Entry.op` an optional field, 
> however as you mentioned in r60933:
>     > Operations are required for those repeated fields in blkio protobuf
>     
>     So I think it should still be a required field.
>     
>     And for the backward compatibility issue mentioned in MESOS-4997, 
> basically I think it will only happen when server (e.g., Mesos master) tries 
> to parse the serialized protobuf string from client (e.g., framework), I do 
> not think this is gonna hanppen in your case. So I would suggest to make 
> `Entry.op` an required field and remove `UNKNOWN` from the `Operation` enum. 
> There are some existing examples that we can referece: the `Image.Type`, 
> `ContainerInfo.Type` and `DiscoveryInfo.Visibility`.

After a second thought, I would still prefer `optional` since I don't think an 
optional field hurts here and they should only be set in the blkio subsystem. 
Also, considering we may upgrade to proto3 at some point, less `required` field 
may make it easier, thoughts?


- Gilbert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60932/#review181023
-----------------------------------------------------------


On July 20, 2017, 4:57 p.m., Gilbert Song wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60932/
> -----------------------------------------------------------
> 
> (Updated July 20, 2017, 4:57 p.m.)
> 
> 
> Review request for mesos, haosdent huang, Jason Lai, Jie Yu, Qian Zhang, and 
> Zhitao Li.
> 
> 
> Bugs: MESOS-6162
>     https://issues.apache.org/jira/browse/MESOS-6162
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Only statistics information for blkio in protobuf.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto 8f8079bd7c2de4e8b2f8f9a56e2731b77b8e1575 
>   include/mesos/v1/mesos.proto 720f307f8d738b0787e7c47be7ee15be38b2c0d0 
> 
> 
> Diff: https://reviews.apache.org/r/60932/diff/3/
> 
> 
> Testing
> -------
> 
> make
> 
> 
> Thanks,
> 
> Gilbert Song
> 
>

Reply via email to