> On Feb. 11, 2017, 1:01 a.m., Benjamin Mahler wrote:
> > src/master/validation.cpp, lines 1612-1629
> > <https://reviews.apache.org/r/55462/diff/4/?file=1629533#file1629533line1612>
> >
> >     Looks like this needs a rebase against master? This block was removed 
> > and the roles are no longer an option.

No, this patch was created against a recent `HEAD`. The modified patch you 
committed as part of r/55461 introduced a loop-local `set<string> 
frameworkRoles` inside the loop over resources. That is nice as it avoids 
keeping two optional, related values in scope (`frameworkInfo` and 
`frameworkRoles`). This comes at the cost of recalculating this framework 
invariant for each loop iteration; I here pulled it out of the loop to not 
recalculate it over and over again. Do you believe that's a bad idea?


> On Feb. 11, 2017, 1:01 a.m., Benjamin Mahler wrote:
> > src/master/validation.cpp, lines 1659-1695
> > <https://reviews.apache.org/r/55462/diff/4/?file=1629533#file1629533line1659>
> >
> >     See my response to the thread in the previous review comments about 
> > validating case (2) as well so that we can provide a better error message 
> > to the operators.

Updated.


> On Feb. 11, 2017, 1:01 a.m., Benjamin Mahler wrote:
> > src/master/validation.cpp, lines 1667-1668
> > <https://reviews.apache.org/r/55462/diff/4/?file=1629533#file1629533line1667>
> >
> >     How about:
> >     
> >     A reserve operation was attempted on unallocated resources, but 
> > frameworks can only perform reservations on allocated resources
> >     
> >     Or:
> >     
> >     A reserve operation was attempted on unallocated resource 'XXX', but 
> > frameworks can only perform reservations on allocated resources

Went for opt 2.


> On Feb. 11, 2017, 1:01 a.m., Benjamin Mahler wrote:
> > src/master/validation.cpp, lines 1665-1693
> > <https://reviews.apache.org/r/55462/diff/4/?file=1629533#file1629533line1665>
> >
> >     Is it possible to get the open and close quotes on the same lines for 
> > these error messages? When on different lines we tend to forget to close 
> > them, e.g.
> >     
> >     ```
> >             return Error(
> >                 "A reserve operation was attempted for a resource allocated 
> > to role"
> >                 " '" + resource.role() + "'"
> >                 ", but the framework only has roles"
> >                 " '" + stringify(frameworkRoles.get()) + "'");
> >     ```

Done.


- Benjamin


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


On Feb. 13, 2017, 4:38 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55462/
> -----------------------------------------------------------
> 
> (Updated Feb. 13, 2017, 4:38 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Jay Guo, and Guangya Liu.
> 
> 
> Bugs: MESOS-6730
>     https://issues.apache.org/jira/browse/MESOS-6730
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This change introduces validation of the 'AllocationInfo' of resources
> used in reservations.
> 
> 
> Diffs
> -----
> 
>   src/master/validation.cpp 2bfca95713319a195e43e990cbc2dc5570b89c4e 
>   src/tests/master_validation_tests.cpp 
> fd1f4a6cf0661351e265e50da1bd6ea04ed13d26 
> 
> Diff: https://reviews.apache.org/r/55462/diff/
> 
> 
> Testing
> -------
> 
> N/A yet.
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>

Reply via email to