mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 55271: Disallow multi-role frameworks to change their roles.
Date Sat, 21 Jan 2017 12:40:00 GMT


> On Jan. 21, 2017, 4:30 a.m., Michael Park wrote:
> > src/master/master.hpp, lines 2475-2516
> > <https://reviews.apache.org/r/55271/diff/13/?file=1610797#file1610797line2475>
> >
> >     We set the `validationError` to `None` just above, so this should always be
`true`. It looks to me like this used to be a loop?
> >     
> >     It looks like this could be:
> >     
> >     ```cpp
> >     if (protobuf::frameworkHasCapability(
> >             info, FrameworkInfo::Capability::MULTI_ROLE) ||
> >         protobuf::frameworkHasCapability(
> >             source, FrameworkInfo::Capability::MULTI_ROLE)) {
> >       // ...
> >       
> >       if (oldRoles != newRoles) {
> >         return Error(...);
> >       }
> >     }
> >     ```

This was supposed to introduce a pattern for when more validation branches would be added;
agree it is overkill ATM, and potentially not even that useful in the future, removed.


> On Jan. 21, 2017, 4:30 a.m., Michael Park wrote:
> > src/tests/master_validation_tests.cpp, lines 2718-2721
> > <https://reviews.apache.org/r/55271/diff/13/?file=1610798#file1610798line2718>
> >
> >     This is quite brittle, not only because the error message could change, but
because we print out a `hashset`, the ordering is not deterministic...
> >     
> >     I might actually suggest using `std::set` so that we get alphabetical ordering
of the role names which I think would be easier to read/compare in an error message.

Agreed, even if the ordering with `hashset` would not depend on the setup and be guaranteed
identical ordering, the ordering produce by a default `set` is more natural.


> On Jan. 21, 2017, 4:30 a.m., Michael Park wrote:
> > src/tests/master_validation_tests.cpp, lines 2723-2724
> > <https://reviews.apache.org/r/55271/diff/13/?file=1610798#file1610798line2723>
> >
> >     Shift indentation to the left, here and below.

Done, also below.


> On Jan. 21, 2017, 4:30 a.m., Michael Park wrote:
> > src/master/master.hpp, line 2481
> > <https://reviews.apache.org/r/55271/diff/13/?file=1610797#file1610797line2481>
> >
> >     We set the `validationError` to `None` just above, so this should always be
`true`. It looks to me like this used to be a loop?
> >     
> >     It looks like this could be:
> >     
> >     ```cpp
> >     if (protobuf::frameworkHasCapability(
> >             info, FrameworkInfo::Capability::MULTI_ROLE) ||
> >         protobuf::frameworkHasCapability(
> >             source, FrameworkInfo::Capability::MULTI_ROLE)) {
> >       // ...
> >       
> >       if (oldRoles != newRoles) {
> >         return Error(...);
> >       }
> >     }
> >     ```

Dropping as this duplicates another issue (see above).


- Benjamin


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


On Jan. 21, 2017, 1:39 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55271/
> -----------------------------------------------------------
> 
> (Updated Jan. 21, 2017, 1:39 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Bugs: MESOS-6631
>     https://issues.apache.org/jira/browse/MESOS-6631
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> We currently do not allow `MULTI_ROLE` frameworks to change their
> roles. This restriction will be lifted later.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp 8e8a9037af11cf95961b6498540a0fd486ed091b 
>   src/tests/master_validation_tests.cpp a63178139a5283d6a3fcbe60c271dab1914e5da9 
> 
> Diff: https://reviews.apache.org/r/55271/diff/
> 
> 
> Testing
> -------
> 
> Tested on various Linux configurations in internal CI.
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message