You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Meng Zhu <mz...@mesosphere.io> on 2019/03/08 07:25:08 UTC
Review Request 70161: Added validation for `QuotaConfig`.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/
-----------------------------------------------------------
Review request for mesos and Benjamin Mahler.
Bugs: MESOS-9596
https://issues.apache.org/jira/browse/MESOS-9596
Repository: mesos
Description
-------
A `QuotaConfig` is valid if the following conditions are met:
(1) The config has a valid non-"*" role.
(2) Resource scalar values are non-negative and finite.
(3) If both guarantees and limits are set for a particular
resource, then guarantee <= limit for that resource.
Diffs
-----
src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
Diff: https://reviews.apache.org/r/70161/diff/1/
Testing
-------
make check
dedicated test added in subsequent patches
Thanks,
Meng Zhu
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213642
-----------------------------------------------------------
Patch looks great!
Reviews applied: [70061, 70062, 70069, 70063, 70148, 70149, 70150, 70151, 70152, 70159, 70160, 70161]
Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers --disable-parallel-test-execution' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh
- Mesos Reviewbot
On March 8, 2019, 7:25 a.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 8, 2019, 7:25 a.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/1/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Meng Zhu <mz...@mesosphere.io>.
> On March 8, 2019, 9:45 a.m., Benjamin Mahler wrote:
> > src/master/quota.cpp
> > Lines 328-331 (patched)
> > <https://reviews.apache.org/r/70161/diff/1/?file=2129602#file2129602line328>
> >
> > Maybe also check isnormal?
Checked as part of the input scalar validation.
- Meng
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213567
-----------------------------------------------------------
On March 12, 2019, 11:41 p.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 12, 2019, 11:41 p.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/2/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213567
-----------------------------------------------------------
src/master/quota.cpp
Lines 316-334 (patched)
<https://reviews.apache.org/r/70161/#comment299540>
Is it possible to re-use a generic Value::Scalar input validator instead of defining inline?
src/master/quota.cpp
Lines 328-331 (patched)
<https://reviews.apache.org/r/70161/#comment299539>
Maybe also check isnormal?
src/master/quota.cpp
Lines 340 (patched)
<https://reviews.apache.org/r/70161/#comment299541>
Can we include in the error string which guarantee is invalid?
src/master/quota.cpp
Lines 348 (patched)
<https://reviews.apache.org/r/70161/#comment299542>
Ditto here for which limit is invalid?
src/master/quota.cpp
Lines 352-366 (patched)
<https://reviews.apache.org/r/70161/#comment299543>
Could this be written as:
```
ResourceLimits limits = x;
ResourceQuantities guarantee = y;
if (!limits.contains(guarantee)) {
// error
}
```
That way, we could consider just unit testing one contains issue for this function and rely on the .contains test for being more comprehensive?
- Benjamin Mahler
On March 8, 2019, 7:25 a.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 8, 2019, 7:25 a.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/1/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Meng Zhu <mz...@mesosphere.io>.
> On March 13, 2019, 12:23 p.m., Benjamin Mahler wrote:
> > src/master/quota.cpp
> > Lines 323-349 (patched)
> > <https://reviews.apache.org/r/70161/diff/2/?file=2131820#file2131820line323>
> >
> > At first I thought there was a missing closing / opening single quotes on these, maybe we should use braces?
> >
> > ```
> > Invalid guarantee configuration {'cpus': NaN}: NaN not supported
> > ```
Done.
- Meng
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213680
-----------------------------------------------------------
On March 12, 2019, 11:41 p.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 12, 2019, 11:41 p.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/3/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213680
-----------------------------------------------------------
Ship it!
src/master/quota.cpp
Lines 323-349 (patched)
<https://reviews.apache.org/r/70161/#comment299678>
At first I thought there was a missing closing / opening single quotes on these, maybe we should use braces?
```
Invalid guarantee configuration {'cpus': NaN}: NaN not supported
```
src/master/quota.cpp
Lines 341-350 (patched)
<https://reviews.apache.org/r/70161/#comment299679>
Nice!
- Benjamin Mahler
On March 13, 2019, 6:41 a.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 13, 2019, 6:41 a.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/2/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/
-----------------------------------------------------------
(Updated March 12, 2019, 11:41 p.m.)
Review request for mesos and Benjamin Mahler.
Changes
-------
Addressed Ben's comment.
Bugs: MESOS-9596
https://issues.apache.org/jira/browse/MESOS-9596
Repository: mesos
Description
-------
A `QuotaConfig` is valid if the following conditions are met:
(1) The config has a valid non-"*" role.
(2) Resource scalar values are non-negative and finite.
(3) If both guarantees and limits are set for a particular
resource, then guarantee <= limit for that resource.
Diffs (updated)
-----
src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
Diff: https://reviews.apache.org/r/70161/diff/2/
Changes: https://reviews.apache.org/r/70161/diff/1-2/
Testing
-------
make check
dedicated test added in subsequent patches
Thanks,
Meng Zhu
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213651
-----------------------------------------------------------
Bad review!
Reviews applied: [70161, 70201, 70152, 70151, 70150, 70149, 70148, 70063, 70069, 70062, 70061, 70160, 70159]
Error:
Circular dependency detected for review 70152.Please fix the 'depends_on' field.
- Mesos Reviewbot
On March 8, 2019, 7:25 a.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 8, 2019, 7:25 a.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/1/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>
Re: Review Request 70161: Added validation for `QuotaConfig`.
Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70161/#review213561
-----------------------------------------------------------
Patch looks great!
Reviews applied: [70061, 70062, 70069, 70063, 70148, 70149, 70150, 70151, 70152, 70159, 70160, 70161]
Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers --disable-parallel-test-execution' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh
- Mesos Reviewbot
On March 8, 2019, 8:25 a.m., Meng Zhu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70161/
> -----------------------------------------------------------
>
> (Updated March 8, 2019, 8:25 a.m.)
>
>
> Review request for mesos and Benjamin Mahler.
>
>
> Bugs: MESOS-9596
> https://issues.apache.org/jira/browse/MESOS-9596
>
>
> Repository: mesos
>
>
> Description
> -------
>
> A `QuotaConfig` is valid if the following conditions are met:
>
> (1) The config has a valid non-"*" role.
>
> (2) Resource scalar values are non-negative and finite.
>
> (3) If both guarantees and limits are set for a particular
> resource, then guarantee <= limit for that resource.
>
>
> Diffs
> -----
>
> src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939
> src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94
>
>
> Diff: https://reviews.apache.org/r/70161/diff/1/
>
>
> Testing
> -------
>
> make check
> dedicated test added in subsequent patches
>
>
> Thanks,
>
> Meng Zhu
>
>