mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <bbann...@apache.org>
Subject Re: Review Request 63256: Added a master validation 'resource::validateSingleResourceProvider'.
Date Mon, 30 Oct 2017 10:20:36 GMT

-----------------------------------------------------------
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
> 
>


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