You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Meng Zhu <mz...@mesosphere.io> on 2019/06/26 06:03:45 UTC

Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

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

(Updated June 25, 2019, 11:03 p.m.)


Review request for mesos and Benjamin Mahler.


Summary (updated)
-----------------

Updated registry operation `UpdateQuota` to persist `QuotaConfig`.


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


Repository: mesos


Description (updated)
-------

The new operations will mutate the `quota_configs` field in
the registry to persist `QuotaConfigs` configured by the new
`UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
`REMOVE_QUOTA` calls.

The operation removes any entries in the legacy `quotas` field
with the same role name. In addition, it also adds/removes the
minimum capability `QUOTA_V2` accordingly: if `quota_configs`
is empty the capability will be removed otherwise it will
be added.

This operation replaces the `REMOVE_QUOTA` operation.

Also fixed affected tests.


Diffs (updated)
-----

  src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
  src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
  src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
  src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
  src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 


Diff: https://reviews.apache.org/r/70951/diff/2/

Changes: https://reviews.apache.org/r/70951/diff/1-2/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/#review216277
-----------------------------------------------------------


Fix it, then Ship it!





src/master/master.cpp
Lines 1740 (patched)
<https://reviews.apache.org/r/70951/#comment303413>

    CHECK_NOT_CONTAINS will already print the second argument?



src/master/quota.cpp
Line 68 (original), 66 (patched)
<https://reviews.apache.org/r/70951/#comment303414>

    should be a 4 space indent..?



src/master/quota.cpp
Lines 68 (patched)
<https://reviews.apache.org/r/70951/#comment303416>

    If it fits, it seems more consistent and readable as `registryConfig`?



src/master/quota.cpp
Line 77 (original), 95 (patched)
<https://reviews.apache.org/r/70951/#comment303415>

    Should be a 4 space indent..?



src/tests/registrar_tests.cpp
Lines 947 (patched)
<https://reviews.apache.org/r/70951/#comment303418>

    the `-> bool` shouldn't be necessary?



src/tests/registrar_tests.cpp
Line 955 (original), 971 (patched)
<https://reviews.apache.org/r/70951/#comment303420>

    Hm.. shouldn't we just be expecting that there's no v2 quota capability written down rather than none at all? (another place the capabilities abstraction would help.. :)).



src/tests/registrar_tests.cpp
Line 994 (original), 1004 (patched)
<https://reviews.apache.org/r/70951/#comment303422>

    Would be great to see the expected vs actual result from these, one way to cleanly do that is using an expected value from json.
    
    That also has the benefit of the reader knowing what the expected value is without having to read all previous operations (diffs) and apply them mentally. (which is a significant cognitive load).



src/tests/registrar_tests.cpp
Lines 1004-1005 (original), 1006-1008 (patched)
<https://reviews.apache.org/r/70951/#comment303423>

    Ditto here, these are pretty brittle since they assume quota v2 is the only capability rather than only looking at quota v2.
    
    If any capability gets added by default, then all these will need to get updated.


- Benjamin Mahler


On June 28, 2019, 9:43 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70951/
> -----------------------------------------------------------
> 
> (Updated June 28, 2019, 9:43 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9601
>     https://issues.apache.org/jira/browse/MESOS-9601
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The new operations will mutate the `quota_configs` field in
> the registry to persist `QuotaConfigs` configured by the new
> `UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
> `REMOVE_QUOTA` calls.
> 
> The operation removes any entries in the legacy `quotas` field
> with the same role name. In addition, it also adds/removes the
> minimum capability `QUOTA_V2` accordingly: if `quota_configs`
> is empty the capability will be removed otherwise it will
> be added.
> 
> This operation replaces the `REMOVE_QUOTA` operation.
> 
> Also fixed affected tests.
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
>   src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
>   src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
>   src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
>   src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 
> 
> 
> Diff: https://reviews.apache.org/r/70951/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/
-----------------------------------------------------------

(Updated June 28, 2019, 2:43 p.m.)


Review request for mesos and Benjamin Mahler.


Changes
-------

Addressed Ben's comment.


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


Repository: mesos


Description
-------

The new operations will mutate the `quota_configs` field in
the registry to persist `QuotaConfigs` configured by the new
`UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
`REMOVE_QUOTA` calls.

The operation removes any entries in the legacy `quotas` field
with the same role name. In addition, it also adds/removes the
minimum capability `QUOTA_V2` accordingly: if `quota_configs`
is empty the capability will be removed otherwise it will
be added.

This operation replaces the `REMOVE_QUOTA` operation.

Also fixed affected tests.


Diffs (updated)
-----

  src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
  src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
  src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
  src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
  src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 


Diff: https://reviews.apache.org/r/70951/diff/5/

Changes: https://reviews.apache.org/r/70951/diff/4-5/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/#review216206
-----------------------------------------------------------




src/master/quota.hpp
Lines 64-65 (original), 58-59 (patched)
<https://reviews.apache.org/r/70951/#comment303296>

    I don't think we need to mention RepeatedPtrField here, you can just say "multiple"
    
    But, do we need to take RepeatedPtrField? Seems like it should just take std::vector?



src/master/quota.hpp
Line 89 (original), 68 (patched)
<https://reviews.apache.org/r/70951/#comment303297>

    Why not std::vector?



src/master/quota.cpp
Line 57 (original), 59 (patched)
<https://reviews.apache.org/r/70951/#comment303299>

    After looking at the complexity of returning whether there is mutation, I think we can just always return true with a TODO. (up to you)
    
    My hunch is we'll maybe just remove the mutation return value, unless there's some real world optimization to be gained from it.



src/master/quota.cpp
Lines 66-72 (patched)
<https://reviews.apache.org/r/70951/#comment303301>

    Wrap at 4:
    
    ```
        int configIndex = find_if(
            registryConfigs.begin(),
            registryConfigs.end(),
            [&](const QuotaConfig& config_) {
              return config_.role() == config.role();
            })
          - registryConfigs.begin();
    ```



src/master/quota.cpp
Lines 97-103 (patched)
<https://reviews.apache.org/r/70951/#comment303303>

    Ditto w.r.t. wrapping



src/master/quota.cpp
Lines 75-89 (original), 113-141 (patched)
<https://reviews.apache.org/r/70951/#comment303298>

    Let's pull something out for this, since it's going to come up again.
    
    E.g.
    
    ```
    protobuf::master::Capabilities capabilities = registry->minimum_capabilities();
    
    capabilities.quotaV2 = !registryConfigs.empty();
    
    *registry->mutable_minimum_capabilities() = capabilities.toStrings();
    ```
    
    Very clean and readable!
    
    For this to work, we have to:
    
    -Update protobuf::master::Capabilities to take in repeated strings (in addition to the existing repeated proto constructor)
    -Carry the unknown capabilities as a member of protobuf::master::Capabilities (we can just tackle the strings for now and leave the existing TODO on the protobuf constructor)
    -Add a toStrings() that goes back to repeated string



src/tests/registrar_tests.cpp
Lines 914-935 (original), 936-958 (patched)
<https://reviews.apache.org/r/70951/#comment303294>

    I find all these variables actually hurt readability, per offline suggestion just inlining the strings and seeing expected json would make this a breeze to read.


- Benjamin Mahler


On June 27, 2019, 9:13 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70951/
> -----------------------------------------------------------
> 
> (Updated June 27, 2019, 9:13 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9601
>     https://issues.apache.org/jira/browse/MESOS-9601
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The new operations will mutate the `quota_configs` field in
> the registry to persist `QuotaConfigs` configured by the new
> `UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
> `REMOVE_QUOTA` calls.
> 
> The operation removes any entries in the legacy `quotas` field
> with the same role name. In addition, it also adds/removes the
> minimum capability `QUOTA_V2` accordingly: if `quota_configs`
> is empty the capability will be removed otherwise it will
> be added.
> 
> This operation replaces the `REMOVE_QUOTA` operation.
> 
> Also fixed affected tests.
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
>   src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
>   src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
>   src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
>   src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 
> 
> 
> Diff: https://reviews.apache.org/r/70951/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/
-----------------------------------------------------------

(Updated June 27, 2019, 2:13 p.m.)


Review request for mesos and Benjamin Mahler.


Changes
-------

Updated the operation to take in repeated QuotaConfigs for all-or-nothing changes.


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


Repository: mesos


Description
-------

The new operations will mutate the `quota_configs` field in
the registry to persist `QuotaConfigs` configured by the new
`UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
`REMOVE_QUOTA` calls.

The operation removes any entries in the legacy `quotas` field
with the same role name. In addition, it also adds/removes the
minimum capability `QUOTA_V2` accordingly: if `quota_configs`
is empty the capability will be removed otherwise it will
be added.

This operation replaces the `REMOVE_QUOTA` operation.

Also fixed affected tests.


Diffs (updated)
-----

  src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
  src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
  src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
  src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
  src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 


Diff: https://reviews.apache.org/r/70951/diff/4/

Changes: https://reviews.apache.org/r/70951/diff/3-4/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/
-----------------------------------------------------------

(Updated June 26, 2019, 9:50 p.m.)


Review request for mesos and Benjamin Mahler.


Changes
-------

Addressed Ben's comments.


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


Repository: mesos


Description
-------

The new operations will mutate the `quota_configs` field in
the registry to persist `QuotaConfigs` configured by the new
`UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
`REMOVE_QUOTA` calls.

The operation removes any entries in the legacy `quotas` field
with the same role name. In addition, it also adds/removes the
minimum capability `QUOTA_V2` accordingly: if `quota_configs`
is empty the capability will be removed otherwise it will
be added.

This operation replaces the `REMOVE_QUOTA` operation.

Also fixed affected tests.


Diffs (updated)
-----

  src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
  src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
  src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
  src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
  src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 


Diff: https://reviews.apache.org/r/70951/diff/3/

Changes: https://reviews.apache.org/r/70951/diff/2-3/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Meng Zhu <mz...@mesosphere.io>.

> On June 26, 2019, 1:21 p.m., Benjamin Mahler wrote:
> > src/master/quota.hpp
> > Line 64 (original), 64 (patched)
> > <https://reviews.apache.org/r/70951/diff/2/?file=2152271#file2152271line64>
> >
> >     What is this comment saying? This constructor is for the UPDATE_QUOTA master call path? Why say that?
> >     
> >     There's also no other constructor, and this comment seems to suggest that there are others for other `XXX_QUOTA` things?

ah, left over from previous iteration. Removed.


> On June 26, 2019, 1:21 p.m., Benjamin Mahler wrote:
> > src/tests/registrar_tests.cpp
> > Lines 944-946 (original), 965-967 (patched)
> > <https://reviews.apache.org/r/70951/diff/2/?file=2152274#file2152274line977>
> >
> >     Shouldn't we be sanity checking the registry protobuf at this point? This can be done by hitting the registrar's endpoint.
> >     
> >     Ditto in the other cases.

We could do that. But I think checking the recovered state does that indirectly and that is consistent with other tests. Let's keep it as is?


> On June 26, 2019, 1:21 p.m., Benjamin Mahler wrote:
> > src/tests/registrar_tests.cpp
> > Lines 954-960 (original), 975-986 (patched)
> > <https://reviews.apache.org/r/70951/diff/2/?file=2152274#file2152274line987>
> >
> >     I'm finding this test rather challenging to read, can we make it more readable than all the micro-checks by showing clearly what the expected registry looks like in json? E.g.
> >     
> >     ```
> >     Registry expected = fromJSON(R"~(
> >         {
> >           "configs": [ ... ]
> >           "capabilities": [ ... ]
> >         }
> >     )~");
> >     
> >     EXPECT_EQ(expected, actual);
> >     ```
> >     
> >     That will make it a lot less of a struggle to read

Used message differencer to avoid comparing field by field.


- Meng


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


On June 26, 2019, 9:50 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70951/
> -----------------------------------------------------------
> 
> (Updated June 26, 2019, 9:50 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9601
>     https://issues.apache.org/jira/browse/MESOS-9601
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The new operations will mutate the `quota_configs` field in
> the registry to persist `QuotaConfigs` configured by the new
> `UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
> `REMOVE_QUOTA` calls.
> 
> The operation removes any entries in the legacy `quotas` field
> with the same role name. In addition, it also adds/removes the
> minimum capability `QUOTA_V2` accordingly: if `quota_configs`
> is empty the capability will be removed otherwise it will
> be added.
> 
> This operation replaces the `REMOVE_QUOTA` operation.
> 
> Also fixed affected tests.
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
>   src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
>   src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
>   src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
>   src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 
> 
> 
> Diff: https://reviews.apache.org/r/70951/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 70951: Updated registry operation `UpdateQuota` to persist `QuotaConfig`.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70951/#review216159
-----------------------------------------------------------




src/master/master.cpp
Lines 1740-1741 (patched)
<https://reviews.apache.org/r/70951/#comment303203>

    Why not just do a .contains here?
    
    Or CHECK_CONTAINS?



src/master/quota.hpp
Line 64 (original), 64 (patched)
<https://reviews.apache.org/r/70951/#comment303204>

    What is this comment saying? This constructor is for the UPDATE_QUOTA master call path? Why say that?
    
    There's also no other constructor, and this comment seems to suggest that there are others for other `XXX_QUOTA` things?



src/master/quota.cpp
Lines 57-63 (original), 58-67 (patched)
<https://reviews.apache.org/r/70951/#comment303205>

    Storing a mutable reference to the configs seems to help readability here?
    
    Also, Maybe find_if is clearer? And the if condition confused me a bit, maybe it's clearer to do it by default quota first, then whether it's found?
    
    ```
    ...& configs;
    
    int configIndex = find_if(
        configs.begin(),
        configs.end(), 
        [&](const QuotaConfig& config) {
          return role == config.role();
        }) - configs.begin();
        
    if (Quota(config) == DEFAULT_QUOTA)) {
      // Erase if present, otherwise no-op.
      if (configIndex < configs.size()) {
        configs.DeleteSubrange(index, 1);
      }
    } else {
      // Modify if present, otherwise insert.
      if (configIndex < configs.size()) {
        *configs.Mutable(index) = config;
      } else {
        *configs.Add() = config;
      }
    }
    ```
    
    Ditto for the infos logic below.



src/master/quota.cpp
Line 75 (original), 102 (patched)
<https://reviews.apache.org/r/70951/#comment303206>

    s/std//



src/master/quota.cpp
Lines 83-84 (original), 105-113 (patched)
<https://reviews.apache.org/r/70951/#comment303207>

    Ditto find_if?



src/master/quota.cpp
Lines 86-89 (original), 115-127 (patched)
<https://reviews.apache.org/r/70951/#comment303208>

    Ditto here, feels more readable if thinking about the inner cases first:
    
    // if capability needs to be present
      // make it present
    // else: capability needs to be absent
      // make it absent



src/master/quota.cpp
Line 91 (original), 129 (patched)
<https://reviews.apache.org/r/70951/#comment303209>

    This is supposed to return true when there's been a mutation, but it's always returning true?
    
    The case where it's a no-op should return false.



src/tests/registrar_tests.cpp
Lines 927-948 (patched)
<https://reviews.apache.org/r/70951/#comment303211>

    Pull this towards the top of the test body, before the twoResourceGuarantees stuff is declared?



src/tests/registrar_tests.cpp
Lines 944-946 (original), 965-967 (patched)
<https://reviews.apache.org/r/70951/#comment303210>

    Shouldn't we be sanity checking the registry protobuf at this point? This can be done by hitting the registrar's endpoint.
    
    Ditto in the other cases.



src/tests/registrar_tests.cpp
Lines 954-960 (original), 975-986 (patched)
<https://reviews.apache.org/r/70951/#comment303213>

    I'm finding this test rather challenging to read, can we make it more readable than all the micro-checks by showing clearly what the expected registry looks like in json? E.g.
    
    ```
    Registry expected = fromJSON(R"~(
        {
          "configs": [ ... ]
          "capabilities": [ ... ]
        }
    )~");
    
    EXPECT_EQ(expected, actual);
    ```
    
    That will make it a lot less of a struggle to read


- Benjamin Mahler


On June 26, 2019, 6:03 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70951/
> -----------------------------------------------------------
> 
> (Updated June 26, 2019, 6:03 a.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-9601
>     https://issues.apache.org/jira/browse/MESOS-9601
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The new operations will mutate the `quota_configs` field in
> the registry to persist `QuotaConfigs` configured by the new
> `UPDATE_QUOTA` call as well as the legacy `SET_QUOTA` and
> `REMOVE_QUOTA` calls.
> 
> The operation removes any entries in the legacy `quotas` field
> with the same role name. In addition, it also adds/removes the
> minimum capability `QUOTA_V2` accordingly: if `quota_configs`
> is empty the capability will be removed otherwise it will
> be added.
> 
> This operation replaces the `REMOVE_QUOTA` operation.
> 
> Also fixed affected tests.
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 826362d1a9ed034a49934b1810d6e1e6cffd90cd 
>   src/master/quota.hpp 959e312b861fc0b59519a9ab5cc51061b55b534c 
>   src/master/quota.cpp a7ee845d5916e859218b0168c7b682f77549aafc 
>   src/master/quota_handler.cpp 476e87eb67e07a2ec6c7b258667cf94ff9c4f8eb 
>   src/tests/registrar_tests.cpp 81979d78f1348791e28f1afea4ca2999de6362b8 
> 
> 
> Diff: https://reviews.apache.org/r/70951/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>