----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/38110/#review106560 -----------------------------------------------------------
Ship it! src/master/master.hpp (line 879) <https://reviews.apache.org/r/38110/#comment165264> How about: ``` Heuristically tries to determine whether a quota request could reasonabily be satisfied given the current cluster capacity. The goal is to determine whether a user may accidentally request an amount that would prevent frameworks without a quota from getting any offers. A force flag will allow users to bypass this check. The heuristic test whether the total quota, including the new request, does not exceed the sum of non-static cluster resources. src/master/master.hpp (line 884) <https://reviews.apache.org/r/38110/#comment165265> s/, what/,as well as which src/master/master.hpp (line 887) <https://reviews.apache.org/r/38110/#comment165266> s/a bunch of agent nodes may terminate right after/ agents may terminate at any time/ src/master/master.hpp (line 890) <https://reviews.apache.org/r/38110/#comment165267> s/verifies the/verifies that the/ src/master/master.hpp (line 892) <https://reviews.apache.org/r/38110/#comment165263> Let's rename this to `CapacityHeuristic` src/master/quota_handler.cpp (lines 97 - 101) <https://reviews.apache.org/r/38110/#comment165273> I think we should either re-run the check that the quota for this role doesn't exist, or in the calculation comment mention that this logic works because master->quotas is guaranteed not to contain the current role's quota yet. src/master/quota_handler.cpp (lines 109 - 110) <https://reviews.apache.org/r/38110/#comment165268> Let's add a comment as to what this next section is, as you did with the previous sections. src/master/quota_handler.cpp (line 110) <https://reviews.apache.org/r/38110/#comment165269> Can we rename this to something like `nonStaticClusterResources` src/master/quota_handler.cpp (lines 112 - 114) <https://reviews.apache.org/r/38110/#comment165270> Is this really necessary? If so let's add a comment. src/master/quota_handler.cpp (lines 117 - 118) <https://reviews.apache.org/r/38110/#comment165272> This is a great comment. Can you also make it clear why we actually want to account for them? src/master/quota_handler.cpp (line 119) <https://reviews.apache.org/r/38110/#comment165271> Then we can rename this to `nonStaticAgentResources`. It might be so clear we can remove the first line of the comment above! :-) src/master/quota_handler.cpp (lines 123 - 126) <https://reviews.apache.org/r/38110/#comment165274> I understand you like the early termination logic as it can reduce the cost of the function significantly. Can you add a comment here that this is an optimization / early exit of the final inequality check? src/master/quota_handler.cpp (line 130) <https://reviews.apache.org/r/38110/#comment165275> hence the request does not pass the heuristic src/master/quota_handler.cpp (line 131) <https://reviews.apache.org/r/38110/#comment165276> Not enough available cluster capacity to reasonably satisfy quota request. Consider using the force attribute src/master/quota_handler.cpp (lines 199 - 200) <https://reviews.apache.org/r/38110/#comment165277> Heuristic capacity check - Joris Van Remoortere On Nov. 14, 2015, 3:44 p.m., Alexander Rukletsov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38110/ > ----------------------------------------------------------- > > (Updated Nov. 14, 2015, 3:44 p.m.) > > > Review request for mesos, Bernd Mathiske, Joerg Schad, Joris Van Remoortere, > Joseph Wu, and Michael Park. > > > Bugs: MESOS-3074 > https://issues.apache.org/jira/browse/MESOS-3074 > > > Repository: mesos > > > Description > ------- > > Performs a check whether a quota request is reasonable and can be satisfied > at the moment. A precise answer is impossible here, but a sanity check is > still helpful, because it allows us to filter knowingly unsatisfiable > requests. > > > Diffs > ----- > > src/master/master.hpp ead8520b7108a0f2c3a0bb11ae7b543897d111a2 > src/master/quota_handler.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/38110/diff/ > > > Testing > ------- > > make check (Mac OS X 10.10.4) > > > Thanks, > > Alexander Rukletsov > >