You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2018/12/11 13:48:41 UTC

Re: Review Request 69398: Added validation for framework IDs.

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

(Updated Dec. 11, 2018, 2:48 p.m.)


Review request for mesos, Benjamin Mahler and Meng Zhu.


Changes
-------

Addressed Ben's comments.


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

Added validation for framework IDs.


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


Repository: mesos


Description (updated)
-------

During scheduler subscription we currently cannot distinguish
self-assigned from master-assigned framework IDs, so we might allow
frameworks to subscribe even if the used framework ID was never assigned
by any master, see MESOS-1719.

This patch adds some validation of used framework IDs so that they can
e.g., savely be used in agents when persisting information.

We also clarify the API to call out that self-assigned framework IDs are
not explicitly supported.


Diffs (updated)
-----

  include/mesos/mesos.proto ef4d785d0bf7b202b4093bad6a478f84c25261f3 
  include/mesos/v1/mesos.proto 4e8f7a1bb1c47761f0407d2f4094aa24ce8c3fef 
  src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
  src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
  src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 


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

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


Testing
-------

`make check`


Thanks,

Benjamin Bannier


Re: Review Request 69398: Added validation for framework IDs.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69398/#review211196
-----------------------------------------------------------



PASS: Mesos patch 69398 was successfully built and tested.

Reviews applied: `['69397', '69398']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2697/mesos-review-69398

- Mesos Reviewbot Windows


On Dec. 11, 2018, 1:48 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69398/
> -----------------------------------------------------------
> 
> (Updated Dec. 11, 2018, 1:48 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Meng Zhu.
> 
> 
> Bugs: MESOS-9469
>     https://issues.apache.org/jira/browse/MESOS-9469
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> During scheduler subscription we currently cannot distinguish
> self-assigned from master-assigned framework IDs, so we might allow
> frameworks to subscribe even if the used framework ID was never assigned
> by any master, see MESOS-1719.
> 
> This patch adds some validation of used framework IDs so that they can
> e.g., savely be used in agents when persisting information.
> 
> We also clarify the API to call out that self-assigned framework IDs are
> not explicitly supported.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto ef4d785d0bf7b202b4093bad6a478f84c25261f3 
>   include/mesos/v1/mesos.proto 4e8f7a1bb1c47761f0407d2f4094aa24ce8c3fef 
>   src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
>   src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
>   src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 
> 
> 
> Diff: https://reviews.apache.org/r/69398/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69398: Added validation for framework IDs.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On Dec. 11, 2018, 11:10 p.m., Benjamin Mahler wrote:
> > src/master/validation.cpp
> > Line 510 (original), 510 (patched)
> > <https://reviews.apache.org/r/69398/diff/2/?file=2113065#file2113065line510>
> >
> >     add an extra newline?

?


> On Dec. 11, 2018, 11:10 p.m., Benjamin Mahler wrote:
> > src/master/validation.cpp
> > Lines 530-536 (patched)
> > <https://reviews.apache.org/r/69398/diff/2/?file=2113065#file2113065line530>
> >
> >     Do we want to return directly? (not an issue)
> >     
> >     ```
> >     return internal::validateFrameworkId(frameworkInfo);
> >     ```

The format I picked makes the copy & paste to add another validation step trivial; suggest to keep it this way.


> On Dec. 11, 2018, 11:10 p.m., Benjamin Mahler wrote:
> > src/tests/master_validation_tests.cpp
> > Lines 4686-4688 (patched)
> > <https://reviews.apache.org/r/69398/diff/2/?file=2113066#file2113066line4686>
> >
> >     s/Empty/Unset/?
> >     
> >     Does this let the empty case through? I think we need to deny that when you consider filesystem path and the sorter path structure.
> >     
> >     Add a test case to ensure empty string is denied?

I added a check for the set but empty case, and we correctly reject such IDs with this patch.

I noticed that in a number of places in the master and scheduler wrapper we maintain handling for set, but empty IDs which are treated as unset IDs. I believe this is not required anymore and posted https://reviews.apache.org/r/69557/ to clean this up.


> On Dec. 11, 2018, 11:10 p.m., Benjamin Mahler wrote:
> > src/tests/master_validation_tests.cpp
> > Lines 4690-4692 (patched)
> > <https://reviews.apache.org/r/69398/diff/2/?file=2113066#file2113066line4690>
> >
> >     Is this actually what we do?
> >     
> >     I believe we append to the master ID:
> >     
> >     https://github.com/apache/mesos/blob/1.7.0/src/master/master.cpp#L11531-L11545
> >     
> >     Which is a UUID:
> >     
> >     https://github.com/apache/mesos/blob/1.7.0/src/master/master.cpp#L337-L338
> >     
> >     So today it's `<master uuid> + "-N"`?

I was oversimplifying a little too much here, switching to use a more realistic format now.


- Benjamin


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


On Dec. 12, 2018, 12:29 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69398/
> -----------------------------------------------------------
> 
> (Updated Dec. 12, 2018, 12:29 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Meng Zhu.
> 
> 
> Bugs: MESOS-9469
>     https://issues.apache.org/jira/browse/MESOS-9469
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> During scheduler subscription we currently cannot distinguish
> self-assigned from master-assigned framework IDs, so we might allow
> frameworks to subscribe even if the used framework ID was never assigned
> by any master, see MESOS-1719.
> 
> This patch adds some validation of used framework IDs so that they can
> e.g., savely be used in agents when persisting information.
> 
> We also clarify the API to call out that self-assigned framework IDs are
> not explicitly supported.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto ef4d785d0bf7b202b4093bad6a478f84c25261f3 
>   include/mesos/v1/mesos.proto 4e8f7a1bb1c47761f0407d2f4094aa24ce8c3fef 
>   src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
>   src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
>   src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 
> 
> 
> Diff: https://reviews.apache.org/r/69398/diff/3/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69398: Added validation for framework IDs.

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


Fix it, then Ship it!




Great description, thank you!

I think we need to make sure the empty string case is denied. If it is already, then we should add a test for it?


src/master/validation.cpp
Line 510 (original), 510 (patched)
<https://reviews.apache.org/r/69398/#comment296143>

    add an extra newline?



src/master/validation.cpp
Lines 530-536 (patched)
<https://reviews.apache.org/r/69398/#comment296142>

    Do we want to return directly? (not an issue)
    
    ```
    return internal::validateFrameworkId(frameworkInfo);
    ```



src/tests/master_validation_tests.cpp
Lines 4686-4688 (patched)
<https://reviews.apache.org/r/69398/#comment296144>

    s/Empty/Unset/?
    
    Does this let the empty case through? I think we need to deny that when you consider filesystem path and the sorter path structure.
    
    Add a test case to ensure empty string is denied?



src/tests/master_validation_tests.cpp
Lines 4690-4692 (patched)
<https://reviews.apache.org/r/69398/#comment296145>

    Is this actually what we do?
    
    I believe we append to the master ID:
    
    https://github.com/apache/mesos/blob/1.7.0/src/master/master.cpp#L11531-L11545
    
    Which is a UUID:
    
    https://github.com/apache/mesos/blob/1.7.0/src/master/master.cpp#L337-L338
    
    So today it's `<master uuid> + "-N"`?


- Benjamin Mahler


On Dec. 11, 2018, 1:48 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69398/
> -----------------------------------------------------------
> 
> (Updated Dec. 11, 2018, 1:48 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Meng Zhu.
> 
> 
> Bugs: MESOS-9469
>     https://issues.apache.org/jira/browse/MESOS-9469
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> During scheduler subscription we currently cannot distinguish
> self-assigned from master-assigned framework IDs, so we might allow
> frameworks to subscribe even if the used framework ID was never assigned
> by any master, see MESOS-1719.
> 
> This patch adds some validation of used framework IDs so that they can
> e.g., savely be used in agents when persisting information.
> 
> We also clarify the API to call out that self-assigned framework IDs are
> not explicitly supported.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto ef4d785d0bf7b202b4093bad6a478f84c25261f3 
>   include/mesos/v1/mesos.proto 4e8f7a1bb1c47761f0407d2f4094aa24ce8c3fef 
>   src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
>   src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
>   src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 
> 
> 
> Diff: https://reviews.apache.org/r/69398/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69398: Added validation for framework IDs.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69398/#review211351
-----------------------------------------------------------



PASS: Mesos patch 69398 was successfully built and tested.

Reviews applied: `['69397', '69557', '69398']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2711/mesos-review-69398

- Mesos Reviewbot Windows


On Dec. 17, 2018, 8:43 a.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69398/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2018, 8:43 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Meng Zhu.
> 
> 
> Bugs: MESOS-9469
>     https://issues.apache.org/jira/browse/MESOS-9469
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> During scheduler subscription we currently cannot distinguish
> self-assigned from master-assigned framework IDs, so we might allow
> frameworks to subscribe even if the used framework ID was never assigned
> by any master, see MESOS-1719.
> 
> This patch adds some validation of used framework IDs so that they can
> e.g., savely be used in agents when persisting information.
> 
> We also clarify the API to call out that self-assigned framework IDs are
> not explicitly supported.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto 137df1f2083059dd06b2b15b50262c54ca3d2043 
>   include/mesos/v1/mesos.proto f121709dff96453c5555b596fc66c8dd3d87b16e 
>   src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
>   src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
>   src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 
> 
> 
> Diff: https://reviews.apache.org/r/69398/diff/4/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69398: Added validation for framework IDs.

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


Ship it!




Ship It!

- Benjamin Mahler


On Dec. 17, 2018, 8:43 a.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69398/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2018, 8:43 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Meng Zhu.
> 
> 
> Bugs: MESOS-9469
>     https://issues.apache.org/jira/browse/MESOS-9469
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> During scheduler subscription we currently cannot distinguish
> self-assigned from master-assigned framework IDs, so we might allow
> frameworks to subscribe even if the used framework ID was never assigned
> by any master, see MESOS-1719.
> 
> This patch adds some validation of used framework IDs so that they can
> e.g., savely be used in agents when persisting information.
> 
> We also clarify the API to call out that self-assigned framework IDs are
> not explicitly supported.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto 137df1f2083059dd06b2b15b50262c54ca3d2043 
>   include/mesos/v1/mesos.proto f121709dff96453c5555b596fc66c8dd3d87b16e 
>   src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
>   src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
>   src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 
> 
> 
> Diff: https://reviews.apache.org/r/69398/diff/4/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69398: Added validation for framework IDs.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69398/
-----------------------------------------------------------

(Updated Dec. 17, 2018, 9:43 a.m.)


Review request for mesos, Benjamin Mahler and Meng Zhu.


Changes
-------

Fixed handling of empty ID case to support current behavior.


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


Repository: mesos


Description
-------

During scheduler subscription we currently cannot distinguish
self-assigned from master-assigned framework IDs, so we might allow
frameworks to subscribe even if the used framework ID was never assigned
by any master, see MESOS-1719.

This patch adds some validation of used framework IDs so that they can
e.g., savely be used in agents when persisting information.

We also clarify the API to call out that self-assigned framework IDs are
not explicitly supported.


Diffs (updated)
-----

  include/mesos/mesos.proto 137df1f2083059dd06b2b15b50262c54ca3d2043 
  include/mesos/v1/mesos.proto f121709dff96453c5555b596fc66c8dd3d87b16e 
  src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
  src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
  src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 


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

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


Testing
-------

`make check`


Thanks,

Benjamin Bannier


Re: Review Request 69398: Added validation for framework IDs.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69398/
-----------------------------------------------------------

(Updated Dec. 12, 2018, 12:29 p.m.)


Review request for mesos, Benjamin Mahler and Meng Zhu.


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


Repository: mesos


Description
-------

During scheduler subscription we currently cannot distinguish
self-assigned from master-assigned framework IDs, so we might allow
frameworks to subscribe even if the used framework ID was never assigned
by any master, see MESOS-1719.

This patch adds some validation of used framework IDs so that they can
e.g., savely be used in agents when persisting information.

We also clarify the API to call out that self-assigned framework IDs are
not explicitly supported.


Diffs (updated)
-----

  include/mesos/mesos.proto ef4d785d0bf7b202b4093bad6a478f84c25261f3 
  include/mesos/v1/mesos.proto 4e8f7a1bb1c47761f0407d2f4094aa24ce8c3fef 
  src/master/validation.hpp 9af903970795a5c8c479d1984a580e41d91f6c91 
  src/master/validation.cpp 5fccc9f4fa6a81c08c5013b06c7b7795897a13a5 
  src/tests/master_validation_tests.cpp 3aa7b2a2dcaf054ad2a67c52462493c97b7178c4 


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

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


Testing
-------

`make check`


Thanks,

Benjamin Bannier