Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-21 Thread Qian Zhang

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



src/master/allocator/mesos/hierarchical.cpp (lines 1342 - 1344)


So here we offer `offerableResources` to framework and mark `resources` as 
allocated resource of the slave. But for a framework in a quota'ed role, 
`offerableResources` and `resources` may be different, the former is revocable 
and the later is non-revocable, so later when `recoverResources()` is called 
(e.g., the offer is declined by framework), we will subtract offered resources 
from allocated resources (`slaves[slaveId].allocated -= resources;`), I think 
the subtraction will not work as we expect since the offered resources are 
revocable but allocated resources are non-revocable.


- Qian Zhang


On Jan. 21, 2016, 1:01 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated Jan. 21, 2016, 1:01 a.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Guangya Liu

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



src/master/allocator/mesos/hierarchical.cpp (line 1310)


The `resource` will include some `reserved` resources, here even if you 
call `resource.mutable_revocable();`, the `reserved` resources will still be 
considered as `reserved`.

Take a look at isReserved()

bool Resources::isReserved(
const Resource& resource,
const Option& role)
{
  if (role.isSome()) {
return !isUnreserved(resource) && role.get() == resource.role();
  } else {
return !isUnreserved(resource);
  }
}

bool Resources::isUnreserved(const Resource& resource)
{
  return resource.role() == "*" && !resource.has_reservation();
}

For a resources such as `cpus(r1):100`, after call 
`resource.mutable_revocable();`, it will be `cpus(r1){REV}:100`, and the helper 
function `isReserved(resources, role)` still treate this as `reserved` 
resources but not `revocable` resources.

This has highly dependency and interaction with MESOS-1607,the optimisitic 
offer phase 1, in phase 1, we are planning to treate the `reserved but not 
used` as `allocation slack`, it is not right if you simply translating all 
`resources` to `revocable`, you may want at least filter out the `reserved` 
resources when translating to `revocalbe` resources.

I would suggest you also invite bmahler as review as he may be the shephard 
for MESOS-1607


- Guangya Liu


On 一月 20, 2016, 5:01 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated 一月 20, 2016, 5:01 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Klaus Ma


> On Jan. 21, 2016, 1:20 a.m., Klaus Ma wrote:
> > src/master/allocator/mesos/hierarchical.cpp, line 1313
> > 
> >
> > Who will kill this `revocable` resources? So we'll have a patch for 
> > evicting?
> 
> Alexander Rukletsov wrote:
> Someday, someway... : )
> 
> Actually, I thought you guys are working on this (oversubscription for 
> reservations, incl. quota)!
> 
> Klaus Ma wrote:
> In "oversubscription for reservations", only `reserved & 
> !persistentVolume` resources are considered to be revocable to other 
> framework; the un-reserved resources are not handled for now.
> 
> To me, the key of eviction is which resources shoulbe be evicted for its 
> owner: 1.) in "oversubscription for reservations", it's `reserved & 
> !persistentVolume`, 2.) in "oversubscription" (Estimator & QoSController), it 
> dependent on modules;
> 
> When I polishing the design doc of Phase 2 (Simultaneous offer), I'm 
> thinking to do fair-share un-reserved resources by Quota/Role's Weight; for 
> example, 100 CPUS in cluster and two Quota: 30 CPUS (role1) & 20 CPUS 
> (role2); when only framework1 in role1 registered, it will get 30 CPUS 
> (reserved) + 30 CPUS (unreserved) + 20 CPUS (revocable), this offer is Quota 
> + (total - Quota1 - Quota2) * (Quota1/(Quota1 + Quota2)) + (total - Quota1 - 
> Quota2) * (Quota2/(Quota1 + Quota2)); when framework2 in role2 registered, 
> the revocable 20CPUS of framework1 will be evicted by master/allocator.
> 
> I logged MESOS-4303 to trace this idea; but did not get enough time on 
> the detail for now :). Maybe we can draft a doc on this, any comments?

typo: the offer should be "30 CPUS (quota) + 30 CPUS (unreserved) + 20 CPUS 
(revocable)".


- Klaus


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


On Jan. 21, 2016, 1:01 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated Jan. 21, 2016, 1:01 a.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Guangya Liu

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


There maybe risk if we want to catch up with 0.27.0 for this.


src/master/allocator/mesos/hierarchical.cpp (lines 1311 - 1314)


I would suggest adding a new revocable type here, according to the design 
of MESOS-1607, this API will set resources as `USAGE SLACK` which means 
`resources allocated but under-utilized`, but here giving `USAGE SLACK` another 
meaning: resources beyond quota which does not fit into the `USAGE SLACK` well.



src/master/allocator/mesos/hierarchical.cpp (line 1313)


I would suggest adding a new revocable type here, according to the design 
of MESOS-1607, this API will set resources as `USAGE SLACK` which means 
`resources allocated but under-utilized`, but here giving `USAGE SLACK` another 
meaning: resources beyond quota which does not fit into the `USAGE SLACK` well.



src/master/allocator/mesos/hierarchical.cpp (line 1329)


The filter will not work after you set the resources as revocable.



src/tests/hierarchical_allocator_tests.cpp (line 1621)


You may encounter some problem if you add some static reserved resources.


- Guangya Liu


On 一月 20, 2016, 5:01 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated 一月 20, 2016, 5:01 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Alexander Rukletsov


> On Jan. 20, 2016, 5:20 p.m., Klaus Ma wrote:
> > src/master/allocator/mesos/hierarchical.cpp, line 1313
> > 
> >
> > Who will kill this `revocable` resources? So we'll have a patch for 
> > evicting?

Someday, someway... : )

Actually, I thought you guys are working on this (oversubscription for 
reservations, incl. quota)!


- Alexander


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


On Jan. 20, 2016, 5:01 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated Jan. 20, 2016, 5:01 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Alexander Rukletsov

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

Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, and 
Qian Zhang.


Bugs: MESOS-4441
https://issues.apache.org/jira/browse/MESOS-4441


Repository: mesos


Description
---

See summary.


Diffs
-

  docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
  src/master/allocator/mesos/hierarchical.cpp 
e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
  src/tests/hierarchical_allocator_tests.cpp 
953712149bd951789beb29c72779c4ac65aa48dc 

Diff: https://reviews.apache.org/r/42559/diff/


Testing
---

On Mac OS 10.10.4:

`GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
--gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
`make check`

Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
fails without.


Thanks,

Alexander Rukletsov



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Klaus Ma

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



src/master/allocator/mesos/hierarchical.cpp (line 1313)


Who will kill this `revocable` resources? So we'll have a patch for 
evicting?


- Klaus Ma


On Jan. 21, 2016, 1:01 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated Jan. 21, 2016, 1:01 a.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 42559: Allocated resources as revocable beyond quota.

2016-01-20 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [42559]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 20, 2016, 5:01 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42559/
> ---
> 
> (Updated Jan. 20, 2016, 5:01 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joris Van Remoortere, Joseph Wu, 
> and Qian Zhang.
> 
> 
> Bugs: MESOS-4441
> https://issues.apache.org/jira/browse/MESOS-4441
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   docs/quota.md 1a6d2f07fb74d168a7eb30764ab9ff80cea5e3b6 
>   src/master/allocator/mesos/hierarchical.cpp 
> e32ee4aa3ed9793bb5a99233e699e5cc2bdd796b 
>   src/tests/hierarchical_allocator_tests.cpp 
> 953712149bd951789beb29c72779c4ac65aa48dc 
> 
> Diff: https://reviews.apache.org/r/42559/diff/
> 
> 
> Testing
> ---
> 
> On Mac OS 10.10.4:
> 
> `GTEST_FILTER="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh 
> --gtest_repeat=100 --gtest_break_on_failure --gtest_shuffle`
> `make check`
> 
> Updated `HierarchicalAllocatorTest.DRFWithQuota` succeeds with the change and 
> fails without.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>