You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jie Yu <yu...@gmail.com> on 2017/10/24 18:05:56 UTC
Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/
-----------------------------------------------------------
Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
Repository: mesos
Description
-------
This validates that all resources are from the same resource provider.
We don't allow an offer operation to be operating on resources from
different resource providers.
Diffs
-----
src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
Diff: https://reviews.apache.org/r/63256/diff/1/
Testing
-------
make check
Thanks,
Jie Yu
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Jie Yu <yu...@gmail.com>.
> On Oct. 25, 2017, 12:32 a.m., Greg Mann wrote:
> > src/master/validation.cpp
> > Lines 821 (patched)
> > <https://reviews.apache.org/r/63256/diff/1/?file=1867604#file1867604line821>
> >
> > `.get()` is not needed here.
In fact, I prefer more explicit here :)
- Jie
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/#review189114
-----------------------------------------------------------
On Oct. 29, 2017, 3:46 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63256/
> -----------------------------------------------------------
>
> (Updated Oct. 29, 2017, 3:46 p.m.)
>
>
> Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This validates that all resources are from the same resource provider.
> We don't allow an offer operation to be operating on resources from
> different resource providers.
>
>
> Diffs
> -----
>
> src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
> src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
> src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
>
>
> Diff: https://reviews.apache.org/r/63256/diff/2/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Benjamin Bannier <bb...@apache.org>.
> On Oct. 25, 2017, 2:32 a.m., Greg Mann wrote:
> > src/master/validation.cpp
> > Lines 816 (patched)
> > <https://reviews.apache.org/r/63256/diff/1/?file=1867604#file1867604line816>
> >
> > "Some resources have a resource provider and some don't"
> >
> > Here and below.
Maybe even `s/don't/do not/` since we are at it.
Here and below.
> On Oct. 25, 2017, 2:32 a.m., Greg Mann wrote:
> > src/tests/master_validation_tests.cpp
> > Lines 285 (patched)
> > <https://reviews.apache.org/r/63256/diff/1/?file=1867605#file1867605line285>
> >
> > I think this might read better if you enclose each test case in a `{}` scope and declare a new `Resources` object in each scope.
+1, would also be great to not reuse `error`.
- Benjamin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/#review189114
-----------------------------------------------------------
On Oct. 29, 2017, 4:46 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63256/
> -----------------------------------------------------------
>
> (Updated Oct. 29, 2017, 4:46 p.m.)
>
>
> Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This validates that all resources are from the same resource provider.
> We don't allow an offer operation to be operating on resources from
> different resource providers.
>
>
> Diffs
> -----
>
> src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
> src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
> src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
>
>
> Diff: https://reviews.apache.org/r/63256/diff/2/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/#review189114
-----------------------------------------------------------
src/master/validation.cpp
Lines 816 (patched)
<https://reviews.apache.org/r/63256/#comment266052>
"Some resources have a resource provider and some don't"
Here and below.
src/master/validation.cpp
Lines 821 (patched)
<https://reviews.apache.org/r/63256/#comment266051>
`.get()` is not needed here.
src/tests/master_validation_tests.cpp
Lines 285 (patched)
<https://reviews.apache.org/r/63256/#comment266053>
I think this might read better if you enclose each test case in a `{}` scope and declare a new `Resources` object in each scope.
- Greg Mann
On Oct. 24, 2017, 6:05 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63256/
> -----------------------------------------------------------
>
> (Updated Oct. 24, 2017, 6:05 p.m.)
>
>
> Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This validates that all resources are from the same resource provider.
> We don't allow an offer operation to be operating on resources from
> different resource providers.
>
>
> Diffs
> -----
>
> src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
> src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
> src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
>
>
> Diff: https://reviews.apache.org/r/63256/diff/1/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Benjamin Bannier <bb...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/#review189553
-----------------------------------------------------------
src/master/validation.cpp
Lines 807 (patched)
<https://reviews.apache.org/r/63256/#comment266679>
This implementation will return an error as soon as two incompatible resource providers are found, but might not warn about all invalid combinations.
Think of a `Resources` with resource providers `{none, A, A, B, C}` we would only warn about `none` and `A`, but not about the incompatibility introduced by `B` and `C` (similar if all `Resource` have some `ResourceProviderID`).
Would it make sense to first extract all resource provider IDs, and only then produce an error?, e.g.,
hashset<Option<ResourceProviderID>> resourceProviders;
foreach(const Resource& resource, resources) {
resourceProviders.insert(
resource.has_provider_id() ? resource.provider_id()
: Option<ResourceProviderID>::none());
}
if (resourceProviders.size() != 1) {
// Generate error.
}
This requires some more space on the error path, but I think it might be worth it.
- Benjamin Bannier
On Oct. 29, 2017, 4:46 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63256/
> -----------------------------------------------------------
>
> (Updated Oct. 29, 2017, 4:46 p.m.)
>
>
> Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This validates that all resources are from the same resource provider.
> We don't allow an offer operation to be operating on resources from
> different resource providers.
>
>
> Diffs
> -----
>
> src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
> src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
> src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
>
>
> Diff: https://reviews.apache.org/r/63256/diff/2/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Benjamin Bannier <bb...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/#review189584
-----------------------------------------------------------
Ship it!
Ship It!
- Benjamin Bannier
On Oct. 30, 2017, 3:28 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63256/
> -----------------------------------------------------------
>
> (Updated Oct. 30, 2017, 3:28 p.m.)
>
>
> Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This validates that all resources are from the same resource provider.
> We don't allow an offer operation to be operating on resources from
> different resource providers.
>
>
> Diffs
> -----
>
> src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
> src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
> src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
>
>
> Diff: https://reviews.apache.org/r/63256/diff/3/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/
-----------------------------------------------------------
(Updated Oct. 30, 2017, 3:23 p.m.)
Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
Bugs: MESOS-7235
https://issues.apache.org/jira/browse/MESOS-7235
Repository: mesos
Description
-------
This validates that all resources are from the same resource provider.
We don't allow an offer operation to be operating on resources from
different resource providers.
Diffs
-----
src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
Diff: https://reviews.apache.org/r/63256/diff/3/
Testing
-------
make check
Thanks,
Jie Yu
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/
-----------------------------------------------------------
(Updated Oct. 30, 2017, 2:28 p.m.)
Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
Changes
-------
Addressed comments.
Repository: mesos
Description
-------
This validates that all resources are from the same resource provider.
We don't allow an offer operation to be operating on resources from
different resource providers.
Diffs (updated)
-----
src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
Diff: https://reviews.apache.org/r/63256/diff/3/
Changes: https://reviews.apache.org/r/63256/diff/2-3/
Testing
-------
make check
Thanks,
Jie Yu
Re: Review Request 63256: Added a master validation
'resource::validateSingleResourceProvider'.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63256/
-----------------------------------------------------------
(Updated Oct. 29, 2017, 3:46 p.m.)
Review request for mesos, Benjamin Bannier, Gaston Kleiman, Greg Mann, and Jan Schlicht.
Changes
-------
Rebased.
Repository: mesos
Description
-------
This validates that all resources are from the same resource provider.
We don't allow an offer operation to be operating on resources from
different resource providers.
Diffs (updated)
-----
src/master/validation.hpp f4925752f20ae8ca4de1d9b4a3d5ffc394db9585
src/master/validation.cpp 42f5742386b59a983f7caaf3400c82b7ef4f8bbb
src/tests/master_validation_tests.cpp 7da1be5233444aded64263d4a763fe2967459042
Diff: https://reviews.apache.org/r/63256/diff/2/
Changes: https://reviews.apache.org/r/63256/diff/1-2/
Testing
-------
make check
Thanks,
Jie Yu