You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jan Schlicht <ja...@mesosphere.io> on 2017/10/18 13:52:20 UTC

Review Request 63105: Added 'apply' handlers for storage operations.

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

Review request for mesos, Benjamin Bannier and Jie Yu.


Repository: mesos


Description
-------

Added 'apply' handlers for storage operations.


Diffs
-----

  src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 


Diff: https://reviews.apache.org/r/63105/diff/1/


Testing
-------

make check


Thanks,

Jan Schlicht


Re: Review Request 63105: Added 'apply' handlers for storage operations.

Posted by Chun-Hung Hsiao <ch...@mesosphere.io>.

> On Oct. 19, 2017, 10:42 p.m., Chun-Hung Hsiao wrote:
> > src/common/resources.cpp
> > Line 1765 (original), 1765 (patched)
> > <https://reviews.apache.org/r/63105/diff/1/?file=1862325#file1862325line1765>
> >
> >     We need a separated validation function. A resource provider will do the following:
> >     ```
> >     Option<Error> error = Resources::validateOperation(operation);
> >     if (error.isSome()) {
> >       Update operation status: OFFER_OPERATION_ERROR;
> >     }
> >     
> >     Do the actual operation, e.g., call CSI.
> >     if (actual operation fails) {
> >       Update oeration status: OFFER_OPERATION_FAILED;
> >     }
> >     
> >     checkpointedResources.apply(target resource);
> >     Update operation status: OFFER_OPERATION_FINISHED;
> >     ```
> >     Can you separate the validation logic from `Resources::apply` and provide an interface?
> >     
> >     We can also use the new validation functions in `src/common/resource_utils.cpp`

Hmm discussed with Jie and now it seems to me that the validation will be done on the master. Then I think for SLRP a single `apply()` is sufficient.


- Chun-Hung


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


On Oct. 18, 2017, 2:36 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63105/
> -----------------------------------------------------------
> 
> (Updated Oct. 18, 2017, 2:36 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Jie Yu.
> 
> 
> Bugs: MESOS-7594
>     https://issues.apache.org/jira/browse/MESOS-7594
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added 'apply' handlers for storage operations.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 
> 
> 
> Diff: https://reviews.apache.org/r/63105/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>


Re: Review Request 63105: Added 'apply' handlers for storage operations.

Posted by Chun-Hung Hsiao <ch...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63105/#review188775
-----------------------------------------------------------




src/common/resources.cpp
Line 1765 (original), 1765 (patched)
<https://reviews.apache.org/r/63105/#comment265782>

    We need a separated validation function. A resource provider will do the following:
    ```
    Option<Error> error = Resources::validateOperation(operation);
    if (error.isSome()) {
      Update operation status: OFFER_OPERATION_ERROR;
    }
    
    Do the actual operation, e.g., call CSI.
    if (actual operation fails) {
      Update oeration status: OFFER_OPERATION_FAILED;
    }
    
    checkpointedResources.apply(target resource);
    Update operation status: OFFER_OPERATION_FINISHED;
    ```
    Can you separate the validation logic from `Resources::apply` and provide an interface?
    
    We can also use the new validation functions in `src/common/resource_utils.cpp`



src/common/resources.cpp
Lines 1776 (patched)
<https://reviews.apache.org/r/63105/#comment265784>

    Here is a list of things to check:
    `source.has_disk()`
    `source.disk().has_source()`
    `!source.disk().source().has_id()`
    `source.disk().source().type() == Resource::DiskInfo::Source::RAW`
    `(operation.create_volume().target_type() == Resource::DiskInfo::Source::PATH || operation.create_volume().target_type() == Resource::DiskInfo::Source::MOUNT)`



src/common/resources.cpp
Lines 1796 (patched)
<https://reviews.apache.org/r/63105/#comment265788>

    `volume.has_disk()`
    `volume.disk().has_source()`
    `volume.disk().source().has_id()`
    `(volume.disk().source()type() == Resource::DiskInfo::Source::PATH || volume.disk().source().type() == Resource::DiskInfo::Source::MOUNT)`
    `!volume.disk().has_persistence()`



src/common/resources.cpp
Lines 1816 (patched)
<https://reviews.apache.org/r/63105/#comment265790>

    `source.has_disk()`
    `source.disk().has_source()`
    `!source.disk().source().has_id()`
    `source.disk().source().type() == Resource::DiskInfo::Source::RAW`



src/common/resources.cpp
Lines 1836 (patched)
<https://reviews.apache.org/r/63105/#comment265793>

    `block.has_disk()`
    `block.disk().has_source()`
    `block.disk().source().has_id()`
    `block.disk().source()type() == Resource::DiskInfo::Source::BLOCK`
    `!volume.disk().has_persistence()`


- Chun-Hung Hsiao


On Oct. 18, 2017, 2:36 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63105/
> -----------------------------------------------------------
> 
> (Updated Oct. 18, 2017, 2:36 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Jie Yu.
> 
> 
> Bugs: MESOS-7594
>     https://issues.apache.org/jira/browse/MESOS-7594
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added 'apply' handlers for storage operations.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 
> 
> 
> Diff: https://reviews.apache.org/r/63105/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>


Re: Review Request 63105: Removed TODOs from storage operation 'apply' handlers.

Posted by Jie Yu <yu...@gmail.com>.

> On Oct. 30, 2017, 10:25 a.m., Benjamin Bannier wrote:
> > src/common/resources.cpp
> > Lines 1765-1779 (original), 1765-1783 (patched)
> > <https://reviews.apache.org/r/63105/diff/2/?file=1864832#file1864832line1765>
> >
> >     Can we collapse these now for readabilty?, e.g.,
> >     
> >         case Offer::Operation::CREATE_VOLUME:
> >         case Offer::Operation::DESTROY_VOLUME:
> >         case Offer::Operation::CREATE_BLOCK:
> >         case Offer::Operation::DESTROY_BLOCK: {
> >           // These operations do not alter the offered resources.
> >           break;
> >         }

This will be changed in the following patches.


- Jie


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


On Oct. 20, 2017, 12:53 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63105/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2017, 12:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Jie Yu.
> 
> 
> Bugs: MESOS-7594
>     https://issues.apache.org/jira/browse/MESOS-7594
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These operations don't alter the offered resources immediately.
> Only after operation feedback has been received, resources might
> be altered. But this will be handled in a different code path.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 
> 
> 
> Diff: https://reviews.apache.org/r/63105/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>


Re: Review Request 63105: Removed TODOs from storage operation 'apply' handlers.

Posted by Benjamin Bannier <bb...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63105/#review189557
-----------------------------------------------------------




src/common/resources.cpp
Lines 1765-1779 (original), 1765-1783 (patched)
<https://reviews.apache.org/r/63105/#comment266687>

    Can we collapse these now for readabilty?, e.g.,
    
        case Offer::Operation::CREATE_VOLUME:
        case Offer::Operation::DESTROY_VOLUME:
        case Offer::Operation::CREATE_BLOCK:
        case Offer::Operation::DESTROY_BLOCK: {
          // These operations do not alter the offered resources.
          break;
        }


- Benjamin Bannier


On Oct. 20, 2017, 2:53 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63105/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2017, 2:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Jie Yu.
> 
> 
> Bugs: MESOS-7594
>     https://issues.apache.org/jira/browse/MESOS-7594
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These operations don't alter the offered resources immediately.
> Only after operation feedback has been received, resources might
> be altered. But this will be handled in a different code path.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 
> 
> 
> Diff: https://reviews.apache.org/r/63105/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>


Re: Review Request 63105: Removed TODOs from storage operation 'apply' handlers.

Posted by Benjamin Bannier <bb...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63105/#review189589
-----------------------------------------------------------


Ship it!




Ship It!

- Benjamin Bannier


On Oct. 20, 2017, 2:53 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63105/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2017, 2:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Jie Yu.
> 
> 
> Bugs: MESOS-7594
>     https://issues.apache.org/jira/browse/MESOS-7594
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These operations don't alter the offered resources immediately.
> Only after operation feedback has been received, resources might
> be altered. But this will be handled in a different code path.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 
> 
> 
> Diff: https://reviews.apache.org/r/63105/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>


Re: Review Request 63105: Removed TODOs from storage operation 'apply' handlers.

Posted by Jan Schlicht <ja...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63105/
-----------------------------------------------------------

(Updated Oct. 20, 2017, 2:53 p.m.)


Review request for mesos, Benjamin Bannier and Jie Yu.


Changes
-------

Changed scope. No longer alters resources.


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

Removed TODOs from storage operation 'apply' handlers.


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


Repository: mesos


Description (updated)
-------

These operations don't alter the offered resources immediately.
Only after operation feedback has been received, resources might
be altered. But this will be handled in a different code path.


Diffs (updated)
-----

  src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 


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

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


Testing
-------

make check


Thanks,

Jan Schlicht


Re: Review Request 63105: Added 'apply' handlers for storage operations.

Posted by Jan Schlicht <ja...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63105/
-----------------------------------------------------------

(Updated Oct. 18, 2017, 4:36 p.m.)


Review request for mesos, Benjamin Bannier and Jie Yu.


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


Repository: mesos


Description
-------

Added 'apply' handlers for storage operations.


Diffs
-----

  src/common/resources.cpp 7ee4dae1389e037531aec533a3d235ee06443ea8 


Diff: https://reviews.apache.org/r/63105/diff/1/


Testing
-------

make check


Thanks,

Jan Schlicht