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 66309: Externalized creation of resource provider manager backing storage.
Date Thu, 19 Apr 2018 09:19:58 GMT


> On April 18, 2018, 11:31 p.m., Chun-Hung Hsiao wrote:
> > src/resource_provider/registrar.hpp
> > Line 69 (original), 71 (patched)
> > <https://reviews.apache.org/r/66309/diff/3/?file=1995440#file1995440line71>
> >
> >     Does it make sense to use `process::Owned<state::Storage>&& storage`?

I don't think so. Taking a value already implies that we take ownership of the passed `storage`,
and to call this function any user would need to provide us with that exclusive ownership
(e.g., by casting some local with `std::move`). All that restricting ourself to rvalues here
would add is that it would enforce correct usage even for broken types which are only semantically
non-copyable, but still define a copy constructor. Unfortunately `Owned` falls into that category
(see MESOS-5122), but I prefer to explicitly move args when passing instead of polluting interfaces
because of tech debt we will fix eventually.


> On April 18, 2018, 11:31 p.m., Chun-Hung Hsiao wrote:
> > src/resource_provider/registrar.hpp
> > Lines 71-73 (original), 73-75 (patched)
> > <https://reviews.apache.org/r/66309/diff/3/?file=1995440#file1995440line73>
> >
> >     I was wondering that, since we have a generic storage-backed registrar, could
we also use this for the master's RP registrar and remove `MasterRegistrar`?

The master registrar is different in that it is already recovered and we need to use it differently
when retrieving its recovered state via above interface, see https://reviews.apache.org/r/66311//


- Benjamin


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


On April 19, 2018, 11:19 a.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66309/
> -----------------------------------------------------------
> 
> (Updated April 19, 2018, 11:19 a.m.)
> 
> 
> Review request for mesos, Jie Yu and Jan Schlicht.
> 
> 
> Bugs: MESOS-8735
>     https://issues.apache.org/jira/browse/MESOS-8735
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the way the storage backing an agent's resource
> provider registrar is created: while before we created it implicitly
> when constructing the registrar, we now consume storage passed on
> construction.
> 
> Being able to explicitly inject the used storage simplifies testing.
> 
> 
> Diffs
> -----
> 
>   src/resource_provider/registrar.hpp 39f45b0a2a7c35bfe72a9305f5248409e4a3ef45 
>   src/resource_provider/registrar.cpp 92ef9aecb1e93d10f46e53984391558f9901a60b 
>   src/tests/resource_provider_manager_tests.cpp c52541bf130ccf4795b989b53331176a64a097ea

> 
> 
> Diff: https://reviews.apache.org/r/66309/diff/4/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


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