[ 
https://issues.apache.org/jira/browse/MESOS-6730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Mahler updated MESOS-6730:
-----------------------------------
    Description: 
When doing dynamic reservation validation, the current logic is make sure the 
reserved resources role is same as the framework role (see 
[src/master/validation.cpp|https://github.com/apache/mesos/blob/0228fa74c25f450478a6a5a42e1ca384c26db8bd/src/master/validation.cpp#L1539-L1544]):

{code}
  if (frameworkRole.isSome() && resource.role() != frameworkRole.get()) {
      return Error(
          "A reserve operation was attempted for a resource with role"
          " '" + resource.role() + "', but the framework can only reserve"
          " resources with role '" + frameworkRole.get() + "'");
    }
{code}

With multi-role framework, we should validate reserved resource role same as 
resource allocation role.

Please make sure distinguish dynamic reservation with framework and http 
endpoint. If dynamic reservation was triggered by a framework, then we need to 
do such validation. If done by the http endpoint, then no need to validate the 
roles.

  was:
When doing dynamic reservation validation, the current logic is make sure the 
reserved resources role is same as the framework role: 
https://github.com/apache/mesos/blob/1.1.x/src/master/validation.cpp#L1458

{code}
  if (frameworkRole.isSome() && resource.role() != frameworkRole.get()) {
      return Error(
          "A reserve operation was attempted for a resource with role"
          " '" + resource.role() + "', but the framework can only reserve"
          " resources with role '" + frameworkRole.get() + "'");
    }
{code}

With multi-role framework, we should validate reserved resource role same as 
resource allocation role.

Please make sure distinguish dynamic reservation with framework and http 
endpoint. If dynamic reservation was triggered by a framework, then we need to 
do such validation. If done by the http endpoint, then no need to validate the 
roles.


> Reserve operation should validate reserved resource role against resource 
> allocationInfo role
> ---------------------------------------------------------------------------------------------
>
>                 Key: MESOS-6730
>                 URL: https://issues.apache.org/jira/browse/MESOS-6730
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Guangya Liu
>
> When doing dynamic reservation validation, the current logic is make sure the 
> reserved resources role is same as the framework role (see 
> [src/master/validation.cpp|https://github.com/apache/mesos/blob/0228fa74c25f450478a6a5a42e1ca384c26db8bd/src/master/validation.cpp#L1539-L1544]):
> {code}
>   if (frameworkRole.isSome() && resource.role() != frameworkRole.get()) {
>       return Error(
>           "A reserve operation was attempted for a resource with role"
>           " '" + resource.role() + "', but the framework can only reserve"
>           " resources with role '" + frameworkRole.get() + "'");
>     }
> {code}
> With multi-role framework, we should validate reserved resource role same as 
> resource allocation role.
> Please make sure distinguish dynamic reservation with framework and http 
> endpoint. If dynamic reservation was triggered by a framework, then we need 
> to do such validation. If done by the http endpoint, then no need to validate 
> the roles.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to