You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Meng Zhu (JIRA)" <ji...@apache.org> on 2019/03/29 21:34:00 UTC

[jira] [Commented] (MESOS-9692) Quota may be under allocated for disk resources.

    [ https://issues.apache.org/jira/browse/MESOS-9692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16805465#comment-16805465 ] 

Meng Zhu commented on MESOS-9692:
---------------------------------

{noformat}
commit b65b57038cb495408078a343ce4401e12d329561
Author: Meng Zhu <mz...@mesosphere.io>
Date:   Fri Mar 29 11:35:42 2019 -0700

    Fixed a bug where disk quota may be under allocated.

    The resources chopping logic in the allocator
    currently overly shrinks resources with the same
    name (e.g. vanilla disk and mount disk) if there
    are multiple such resources. Currently only
    different disk resources might share the same
    name (we only chop unreserved/non-revocable/non-shared
    resources). This would lead to disk quota being under
    allocated. This patch corrects the shrinking logic.
    See MESOS-9692.

    Review: https://reviews.apache.org/r/70344
{noformat}


> Quota may be under allocated for disk resources.
> ------------------------------------------------
>
>                 Key: MESOS-9692
>                 URL: https://issues.apache.org/jira/browse/MESOS-9692
>             Project: Mesos
>          Issue Type: Bug
>          Components: allocation
>    Affects Versions: 1.5.3, 1.6.2, 1.7.2
>            Reporter: Meng Zhu
>            Assignee: Meng Zhu
>            Priority: Major
>              Labels: mesosphere, resource-management
>
> Due to a bug in the resources chopping logic:
> https://github.com/apache/mesos/blob/1915150c6a83cd95197e25a68a6adf9b3ef5fb11/src/master/allocator/mesos/hierarchical.cpp#L1665-L1668
> {noformat}
>       if (Resources::shrink(&resource, limitScalar.get())) {
>         targetScalarQuantites[resource.name()] -= limitScalar.get(); // bug
>         result += std::move(resource);
>       }
> {noformat}
> When chopping different resources with the same name (e.g. vanilla disk and mount disk), we only include one of the resources. For example, if a role has a quota of 100disk, and an agent has 50 vanilla disk and 50 mount disk, the offer will only contain 50 disk (either vanilla or the mount type). The correct behavior should be that both disks should be offered.
> Since today, only disk resources might have the same name but different meta-data (for unreserved/nonrevocable/nonshared resources -- we only chop this), this bug should only affect disk resources today.
> The correct code should be:
> {noformat}
>       if (Resources::shrink(&resource, limitScalar.get())) {
>         targetScalarQuantites[resource.name()] -= resource.scalar(); // Only subtract the shrunk resource scalar
>         result += std::move(resource);
>       }
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)