You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jiang Yan Xu <ya...@jxu.me> on 2017/04/24 05:48:09 UTC

Re: Review Request 55897: Add support for not enforcing XFS quotas.

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



Partial review for discussion.


src/slave/containerizer/mesos/isolators/xfs/disk.cpp
Lines 174 (patched)
<https://reviews.apache.org/r/55897/#comment245783>

    `quotaPolicy(_quotaPolicy)` by convention.



src/slave/containerizer/mesos/isolators/xfs/utils.hpp
Lines 65 (patched)
<https://reviews.apache.org/r/55897/#comment245781>

    We started to move toward `enum class` now.



src/slave/containerizer/mesos/isolators/xfs/utils.hpp
Lines 66-67 (patched)
<https://reviews.apache.org/r/55897/#comment245782>

    With enum class it's safe to just
    
    s/QUOTA_POLICY_ENFORCING/ENFORCING/
    s/QUOTA_POLICY_ACCOUNTING/ACCOUNTING/
    
    for brevity.



src/slave/containerizer/mesos/isolators/xfs/utils.cpp
Lines 148 (patched)
<https://reviews.apache.org/r/55897/#comment245811>

    I guess the way it works is that we have selected these two fields but provided 0 values through zero initialization. Maybe a short comment to make this explicit?



src/slave/containerizer/mesos/isolators/xfs/utils.cpp
Lines 153-154 (original), 185-186 (patched)
<https://reviews.apache.org/r/55897/#comment245793>

    Does this comment need adjustment now that we are using the soft limit differently?
    
    I have questions about the need for soft limit below but I don't recall the reason for setting the soft limits earlier "just for consistency". Soft limits is one of the low-level system's funtionality that we didn't use. If we didn't use it, I am not sure about the need for our util or the reader to be aware of it (the concept of soft limit)?



src/slave/containerizer/mesos/isolators/xfs/utils.cpp
Lines 195 (patched)
<https://reviews.apache.org/r/55897/#comment245812>

    The fact that `0u` means clearing the quota perhaps worth a short comment?



src/slave/containerizer/mesos/isolators/xfs/utils.cpp
Lines 196 (patched)
<https://reviews.apache.org/r/55897/#comment245813>

    From reading the references it seems that the soft limits and non-enforcement are two different things? 
    
    Plus, the behavior when the soft limit is hit is subject to [ID zero's d_btimer value](http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure/tmp/en-US/html/Internal_Inodes.html) which could be set out-of-band so it could totally do things not expected here?
    
    It looks like we can still just rely on `d_blk_hardlimit`: set it in the enforcement mode and don't set it at all in the accounting-only mode?
    
    I could be totally mistaken but if I am, we should improve the documentation to clarify for the readers.


- Jiang Yan Xu


On March 17, 2017, 2:57 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55897/
> -----------------------------------------------------------
> 
> (Updated March 17, 2017, 2:57 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-5116
>     https://issues.apache.org/jira/browse/MESOS-5116
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add XFS disk isolator support for not enforcing disk quotas on
> containers. While there is a global filesystem configuration option
> to turn off quota enforcement, we should not automatically toggle
> that because we don't know why the operator might have changed that
> configuration. Instead, we use the soft quota limit to implement
> an accounting quota and the hard limit for an enforced quota.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/xfs/disk.hpp 52f0459421a45b01ce38b17c689633301cd97982 
>   src/slave/containerizer/mesos/isolators/xfs/disk.cpp 40f1049358ad99d3f213289e36def81c580f07f3 
>   src/slave/containerizer/mesos/isolators/xfs/utils.hpp eddd4c37fb42339ca21ecb392dea47acf6b277bb 
>   src/slave/containerizer/mesos/isolators/xfs/utils.cpp 8018ad348d26bd962357543a5fb9f6cb43ff13b1 
>   src/tests/containerizer/xfs_quota_tests.cpp 7beb60b059910a0d4451b1ace895a35dc974a043 
> 
> 
> Diff: https://reviews.apache.org/r/55897/diff/2/
> 
> 
> Testing
> -------
> 
> sudo make check (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 55897: Add support for not enforcing XFS quotas.

Posted by James Peach <jp...@apache.org>.

> On April 24, 2017, 5:48 a.m., Jiang Yan Xu wrote:
> > src/slave/containerizer/mesos/isolators/xfs/utils.cpp
> > Lines 196 (patched)
> > <https://reviews.apache.org/r/55897/diff/2/?file=1667426#file1667426line196>
> >
> >     From reading the references it seems that the soft limits and non-enforcement are two different things? 
> >     
> >     Plus, the behavior when the soft limit is hit is subject to [ID zero's d_btimer value](http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure/tmp/en-US/html/Internal_Inodes.html) which could be set out-of-band so it could totally do things not expected here?
> >     
> >     It looks like we can still just rely on `d_blk_hardlimit`: set it in the enforcement mode and don't set it at all in the accounting-only mode?
> >     
> >     I could be totally mistaken but if I am, we should improve the documentation to clarify for the readers.

Reimplemented to not use soft limits.


- James


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


On April 25, 2017, 10:37 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55897/
> -----------------------------------------------------------
> 
> (Updated April 25, 2017, 10:37 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-5116
>     https://issues.apache.org/jira/browse/MESOS-5116
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add XFS disk isolator support for not enforcing disk quotas on
> containers. While there is a global filesystem configuration option
> to turn off quota enforcement, we should not automatically toggle
> that because we don't know why the operator might have changed that
> configuration. Instead, we just apply an unlimited (0) quota, which
> engages XFS space accounting without enforcing any limit.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/xfs/disk.hpp 52f0459421a45b01ce38b17c689633301cd97982 
>   src/slave/containerizer/mesos/isolators/xfs/disk.cpp 40f1049358ad99d3f213289e36def81c580f07f3 
>   src/slave/containerizer/mesos/isolators/xfs/utils.hpp eddd4c37fb42339ca21ecb392dea47acf6b277bb 
>   src/tests/containerizer/xfs_quota_tests.cpp 7beb60b059910a0d4451b1ace895a35dc974a043 
> 
> 
> Diff: https://reviews.apache.org/r/55897/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 55897: Add support for not enforcing XFS quotas.

Posted by James Peach <jp...@apache.org>.

> On April 24, 2017, 5:48 a.m., Jiang Yan Xu wrote:
> > src/slave/containerizer/mesos/isolators/xfs/utils.hpp
> > Lines 65 (patched)
> > <https://reviews.apache.org/r/55897/diff/2/?file=1667425#file1667425line65>
> >
> >     We started to move toward `enum class` now.

Really? There are only 14 uses of `enum class` ad it is not mentioned in the style guide AFAICT.


- James


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


On March 17, 2017, 9:57 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55897/
> -----------------------------------------------------------
> 
> (Updated March 17, 2017, 9:57 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-5116
>     https://issues.apache.org/jira/browse/MESOS-5116
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add XFS disk isolator support for not enforcing disk quotas on
> containers. While there is a global filesystem configuration option
> to turn off quota enforcement, we should not automatically toggle
> that because we don't know why the operator might have changed that
> configuration. Instead, we use the soft quota limit to implement
> an accounting quota and the hard limit for an enforced quota.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/xfs/disk.hpp 52f0459421a45b01ce38b17c689633301cd97982 
>   src/slave/containerizer/mesos/isolators/xfs/disk.cpp 40f1049358ad99d3f213289e36def81c580f07f3 
>   src/slave/containerizer/mesos/isolators/xfs/utils.hpp eddd4c37fb42339ca21ecb392dea47acf6b277bb 
>   src/slave/containerizer/mesos/isolators/xfs/utils.cpp 8018ad348d26bd962357543a5fb9f6cb43ff13b1 
>   src/tests/containerizer/xfs_quota_tests.cpp 7beb60b059910a0d4451b1ace895a35dc974a043 
> 
> 
> Diff: https://reviews.apache.org/r/55897/diff/2/
> 
> 
> Testing
> -------
> 
> sudo make check (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 55897: Add support for not enforcing XFS quotas.

Posted by Jiang Yan Xu <ya...@jxu.me>.

> On April 23, 2017, 10:48 p.m., Jiang Yan Xu wrote:
> > src/slave/containerizer/mesos/isolators/xfs/utils.hpp
> > Lines 65 (patched)
> > <https://reviews.apache.org/r/55897/diff/2/?file=1667425#file1667425line65>
> >
> >     We started to move toward `enum class` now.
> 
> James Peach wrote:
>     Really? There are only 14 uses of `enum class` ad it is not mentioned in the style guide AFAICT.

14 uses because it's new. I haven't seen new code use the old enum. Any downsides of using it here?

Yeah we should add it to the style guide.


- Jiang Yan


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


On March 17, 2017, 2:57 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55897/
> -----------------------------------------------------------
> 
> (Updated March 17, 2017, 2:57 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-5116
>     https://issues.apache.org/jira/browse/MESOS-5116
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add XFS disk isolator support for not enforcing disk quotas on
> containers. While there is a global filesystem configuration option
> to turn off quota enforcement, we should not automatically toggle
> that because we don't know why the operator might have changed that
> configuration. Instead, we use the soft quota limit to implement
> an accounting quota and the hard limit for an enforced quota.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/xfs/disk.hpp 52f0459421a45b01ce38b17c689633301cd97982 
>   src/slave/containerizer/mesos/isolators/xfs/disk.cpp 40f1049358ad99d3f213289e36def81c580f07f3 
>   src/slave/containerizer/mesos/isolators/xfs/utils.hpp eddd4c37fb42339ca21ecb392dea47acf6b277bb 
>   src/slave/containerizer/mesos/isolators/xfs/utils.cpp 8018ad348d26bd962357543a5fb9f6cb43ff13b1 
>   src/tests/containerizer/xfs_quota_tests.cpp 7beb60b059910a0d4451b1ace895a35dc974a043 
> 
> 
> Diff: https://reviews.apache.org/r/55897/diff/2/
> 
> 
> Testing
> -------
> 
> sudo make check (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>