You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Chun-Hung Hsiao <ch...@apache.org> on 2019/03/15 05:17:04 UTC

Review Request 70216: Implemented the recovery logic for v0 `VolumeManager`.

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

Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.


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


Repository: mesos


Description
-------

The recovery logic is similar to SLRP's `recoverVolumes` method. But
`VolumeManager` no longer recovers all volumes to their steady states
since this is not necessary. Together with the new `publishVolume`
design, the recovery logic is now simpler.


Diffs
-----

  src/csi/v0_volume_manager.cpp PRE-CREATION 
  src/csi/v0_volume_manager_process.hpp PRE-CREATION 


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


Testing
-------

make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 70216: Implemented the recovery logic for v0 `VolumeManager`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.

> On March 20, 2019, 3:13 p.m., Benjamin Bannier wrote:
> > src/csi/v0_volume_manager.cpp
> > Lines 440 (patched)
> > <https://reviews.apache.org/r/70216/diff/2/?file=2132475#file2132475line440>
> >
> >     Should we have used an `Option` for this member?

I'm relying on the fact that the default capabilities are all off, and only turned on after recovery finishes, to avoid code like
```
if (pluginCapabilities.isSome() && pluginCapabilities->controllerService) {
  ...
}
```
That said, if this is more readable, I'm willing to change this and other capabilities variables to `Option`. WDYT?


> On March 20, 2019, 3:13 p.m., Benjamin Bannier wrote:
> > src/csi/v0_volume_manager.cpp
> > Lines 507 (patched)
> > <https://reviews.apache.org/r/70216/diff/2/?file=2132475#file2132475line507>
> >
> >     `Option`?

It's already an `Option`. Dropping.


- Chun-Hung


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


On March 15, 2019, 5:17 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 15, 2019, 5:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The recovery logic is similar to SLRP's `recoverVolumes` method. But
> `VolumeManager` no longer recovers all volumes to their steady states
> since this is not necessary. Together with the new `publishVolume`
> design, the recovery logic is now simpler.
> 
> 
> Diffs
> -----
> 
>   src/csi/v0_volume_manager.cpp PRE-CREATION 
>   src/csi/v0_volume_manager_process.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

Posted by Chun-Hung Hsiao <ch...@apache.org>.

> On March 20, 2019, 3:13 p.m., Benjamin Bannier wrote:
> > src/csi/v0_volume_manager_process.hpp
> > Lines 176 (patched)
> > <https://reviews.apache.org/r/70216/diff/2/?file=2132476#file2132476line176>
> >
> >     Can or should this be `const`?
> 
> Chun-Hung Hsiao wrote:
>     Although this can, it has a side effect that's not directly related to the data members. Given this, and given that it's an actor in a non-copyable object, I'd prefer not adding the `const` qualifier to give an illusion that it's side-effect free. WDYT?

Dropping this for now. Feel free to reopen.


- Chun-Hung


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


On March 28, 2019, 7:55 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 28, 2019, 7:55 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> In addition to perform volume state recovery, the `recoverVolumes`
> function also recovers service manager and preparing services now. The
> whole logic will be moved out from SLRP to v0 `VolumeManager` later.
> 
> During volume state recovery, we no longer recover all volumes to steady
> states, since transient states are properly handled in SLRP. To simplify
> the recovery logic, a `publishVolume` method that conforms to the volume
> manager's `publishVolume` is introduced.
> 
> 
> Diffs
> -----
> 
>   src/resource_provider/storage/provider.cpp 2711503cdb58cb9b34af8c9fad0908c5f788a2af 
>   src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/6/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Implemented the recovery logic for v0 `VolumeManager`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.

> On March 20, 2019, 3:13 p.m., Benjamin Bannier wrote:
> > src/csi/v0_volume_manager_process.hpp
> > Lines 176 (patched)
> > <https://reviews.apache.org/r/70216/diff/2/?file=2132476#file2132476line176>
> >
> >     Can or should this be `const`?

Although this can, it has a side effect that's not directly related to the data members. Given this, and given that it's an actor in a non-copyable object, I'd prefer not adding the `const` qualifier to give an illusion that it's side-effect free. WDYT?


- Chun-Hung


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


On March 15, 2019, 5:17 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 15, 2019, 5:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The recovery logic is similar to SLRP's `recoverVolumes` method. But
> `VolumeManager` no longer recovers all volumes to their steady states
> since this is not necessary. Together with the new `publishVolume`
> design, the recovery logic is now simpler.
> 
> 
> Diffs
> -----
> 
>   src/csi/v0_volume_manager.cpp PRE-CREATION 
>   src/csi/v0_volume_manager_process.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Implemented the recovery logic for v0 `VolumeManager`.

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



Let's squash the corresponding changes from https://reviews.apache.org/r/70222/ into this patch.


src/csi/v0_volume_manager.cpp
Lines 157 (patched)
<https://reviews.apache.org/r/70216/#comment299933>

    `continue` for `None` case?



src/csi/v0_volume_manager.cpp
Lines 199 (patched)
<https://reviews.apache.org/r/70216/#comment299934>

    We could do an early return for invalid state to reduce nesting.



src/csi/v0_volume_manager.cpp
Lines 437 (patched)
<https://reviews.apache.org/r/70216/#comment299925>

    Let's assert that we have some `services`.



src/csi/v0_volume_manager.cpp
Lines 440 (patched)
<https://reviews.apache.org/r/70216/#comment299926>

    Should we have used an `Option` for this member?



src/csi/v0_volume_manager.cpp
Lines 452 (patched)
<https://reviews.apache.org/r/70216/#comment299917>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 454 (patched)
<https://reviews.apache.org/r/70216/#comment299924>

    Expand type, `CSIPluginContainerInfo::Service`.



src/csi/v0_volume_manager.cpp
Lines 455-456 (patched)
<https://reviews.apache.org/r/70216/#comment299927>

    This would be much easier to read if we had the function call all on a single line.



src/csi/v0_volume_manager.cpp
Lines 463 (patched)
<https://reviews.apache.org/r/70216/#comment299918>

    `[]`, this lambda doesn't need to execute on this process.



src/csi/v0_volume_manager.cpp
Lines 465 (patched)
<https://reviews.apache.org/r/70216/#comment299928>

    I was wondering what was special about `size==2`. Maybe expand to cover all sizes (same `name`, `vendor_version`)?



src/csi/v0_volume_manager.cpp
Lines 478 (patched)
<https://reviews.apache.org/r/70216/#comment299919>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 485 (patched)
<https://reviews.apache.org/r/70216/#comment299920>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 487 (patched)
<https://reviews.apache.org/r/70216/#comment299929>

    Should we have an `Option` member instead?



src/csi/v0_volume_manager.cpp
Lines 492 (patched)
<https://reviews.apache.org/r/70216/#comment299921>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 499 (patched)
<https://reviews.apache.org/r/70216/#comment299922>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 501 (patched)
<https://reviews.apache.org/r/70216/#comment299930>

    `Option` member?



src/csi/v0_volume_manager.cpp
Lines 505 (patched)
<https://reviews.apache.org/r/70216/#comment299923>

    `[this]`



src/csi/v0_volume_manager.cpp
Lines 507 (patched)
<https://reviews.apache.org/r/70216/#comment299931>

    `Option`?



src/csi/v0_volume_manager_process.hpp
Lines 176 (patched)
<https://reviews.apache.org/r/70216/#comment299932>

    Can or should this be `const`?


- Benjamin Bannier


On March 15, 2019, 6:17 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 15, 2019, 6:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The recovery logic is similar to SLRP's `recoverVolumes` method. But
> `VolumeManager` no longer recovers all volumes to their steady states
> since this is not necessary. Together with the new `publishVolume`
> design, the recovery logic is now simpler.
> 
> 
> Diffs
> -----
> 
>   src/csi/v0_volume_manager.cpp PRE-CREATION 
>   src/csi/v0_volume_manager_process.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

Posted by Chun-Hung Hsiao <ch...@apache.org>.

> On March 25, 2019, 11:46 a.m., Benjamin Bannier wrote:
> > src/resource_provider/storage/provider.cpp
> > Line 618 (original)
> > <https://reviews.apache.org/r/70216/diff/4/?file=2133677#file2133677line707>
> >
> >     WE are we not checkpointing this anymore since it was always a no-op anyway, right?

Right. Checkpointing such states are not very useful, as they are meant to keep track of external interactions (i.e., making calls to the plugin). If another crash happens, the same recovery logic will put it back to `NODE_READY` again.


> On March 25, 2019, 11:46 a.m., Benjamin Bannier wrote:
> > src/resource_provider/storage/provider.cpp
> > Line 1736 (original), 1553 (patched)
> > <https://reviews.apache.org/r/70216/diff/4/?file=2133677#file2133677line1884>
> >
> >     Should we add a message, here and below?

This will be removed in later patches. Eventually `VolumeManager` would return a failure in all public-facing functions if `volumeId` is unknown.


> On March 25, 2019, 11:46 a.m., Benjamin Bannier wrote:
> > src/resource_provider/storage/provider.cpp
> > Line 1736 (original), 1553 (patched)
> > <https://reviews.apache.org/r/70216/diff/4/?file=2133677#file2133677line1884>
> >
> >     Should we add a message, here and below?

This will be removed in the next patch.


- Chun-Hung


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


On March 27, 2019, 5:57 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 27, 2019, 5:57 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> In addition to perform volume state recovery, the `recoverVolumes`
> function also recovers service manager and preparing services now. The
> whole logic will be moved out from SLRP to v0 `VolumeManager` later.
> 
> During volume state recovery, we no longer recover all volumes to steady
> states, since transient states are properly handled in SLRP. To simplify
> the recovery logic, a `publishVolume` method that conforms to the volume
> manager's `publishVolume` is introduced.
> 
> 
> Diffs
> -----
> 
>   src/resource_provider/storage/provider.cpp 2711503cdb58cb9b34af8c9fad0908c5f788a2af 
>   src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

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


Fix it, then Ship it!




Thanks for the patch reorganization, this has less noise now and is not as hard to understand anymore.


src/resource_provider/storage/provider.cpp
Lines 615 (patched)
<https://reviews.apache.org/r/70216/#comment300118>

    `[this]`



src/resource_provider/storage/provider.cpp
Line 618 (original)
<https://reviews.apache.org/r/70216/#comment300120>

    WE are we not checkpointing this anymore since it was always a no-op anyway, right?



src/resource_provider/storage/provider.cpp
Line 1736 (original), 1553 (patched)
<https://reviews.apache.org/r/70216/#comment300123>

    Should we add a message, here and below?



src/resource_provider/storage/provider.cpp
Lines 1559 (patched)
<https://reviews.apache.org/r/70216/#comment300122>

    `[this, volumeId]`


- Benjamin Bannier


On March 23, 2019, 12:31 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70216/
> -----------------------------------------------------------
> 
> (Updated March 23, 2019, 12:31 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9622
>     https://issues.apache.org/jira/browse/MESOS-9622
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> In addition to perform volume state recovery, the `recoverVolumes`
> function also recovers service manager and preparing services now. The
> whole logic will be moved out from SLRP to v0 `VolumeManager` later.
> 
> During volume state recovery, we no longer recover all volumes to steady
> states, since transient states are properly handled in SLRP. To simplify
> the recovery logic, a `publishVolume` method that conforms to the volume
> manager's `publishVolume` is introduced.
> 
> 
> Diffs
> -----
> 
>   src/resource_provider/storage/provider.cpp fea623c292158deb1b4b4b9ab1ac208031471519 
>   src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 
> 
> 
> Diff: https://reviews.apache.org/r/70216/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

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

(Updated March 28, 2019, 7:55 a.m.)


Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.


Changes
-------

Addressed Benjamin's comments.


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


Repository: mesos


Description
-------

In addition to perform volume state recovery, the `recoverVolumes`
function also recovers service manager and preparing services now. The
whole logic will be moved out from SLRP to v0 `VolumeManager` later.

During volume state recovery, we no longer recover all volumes to steady
states, since transient states are properly handled in SLRP. To simplify
the recovery logic, a `publishVolume` method that conforms to the volume
manager's `publishVolume` is introduced.


Diffs (updated)
-----

  src/resource_provider/storage/provider.cpp 2711503cdb58cb9b34af8c9fad0908c5f788a2af 
  src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 


Diff: https://reviews.apache.org/r/70216/diff/6/

Changes: https://reviews.apache.org/r/70216/diff/5-6/


Testing
-------

make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

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

(Updated March 27, 2019, 5:57 a.m.)


Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.


Changes
-------

Rebased.


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


Repository: mesos


Description
-------

In addition to perform volume state recovery, the `recoverVolumes`
function also recovers service manager and preparing services now. The
whole logic will be moved out from SLRP to v0 `VolumeManager` later.

During volume state recovery, we no longer recover all volumes to steady
states, since transient states are properly handled in SLRP. To simplify
the recovery logic, a `publishVolume` method that conforms to the volume
manager's `publishVolume` is introduced.


Diffs (updated)
-----

  src/resource_provider/storage/provider.cpp 2711503cdb58cb9b34af8c9fad0908c5f788a2af 
  src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 


Diff: https://reviews.apache.org/r/70216/diff/5/

Changes: https://reviews.apache.org/r/70216/diff/4-5/


Testing
-------

make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

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

(Updated March 22, 2019, 11:31 p.m.)


Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.


Changes
-------

Inlined an internal recovery helper so the recovery logic is in one place.


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


Repository: mesos


Description
-------

In addition to perform volume state recovery, the `recoverVolumes`
function also recovers service manager and preparing services now. The
whole logic will be moved out from SLRP to v0 `VolumeManager` later.

During volume state recovery, we no longer recover all volumes to steady
states, since transient states are properly handled in SLRP. To simplify
the recovery logic, a `publishVolume` method that conforms to the volume
manager's `publishVolume` is introduced.


Diffs (updated)
-----

  src/resource_provider/storage/provider.cpp fea623c292158deb1b4b4b9ab1ac208031471519 
  src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 


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

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


Testing
-------

make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 70216: Cleanup the recovery logic for refactoring SLRP.

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

(Updated March 22, 2019, 6:14 a.m.)


Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.


Changes
-------

Addressed Benjamin's comments and restructure the refactoring. Now it's done in SLRP first.


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

Cleanup the recovery logic for refactoring SLRP.


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


Repository: mesos


Description (updated)
-------

In addition to perform volume state recovery, the `recoverVolumes`
function also recovers service manager and preparing services now. The
whole logic will be moved out from SLRP to v0 `VolumeManager` later.

During volume state recovery, we no longer recover all volumes to steady
states, since transient states are properly handled in SLRP. To simplify
the recovery logic, a `publishVolume` method that conforms to the volume
manager's `publishVolume` is introduced.


Diffs (updated)
-----

  src/resource_provider/storage/provider.cpp fea623c292158deb1b4b4b9ab1ac208031471519 
  src/resource_provider/storage/provider_process.hpp a5536b3d735e01eb1c4dc52d0602d973155f3c93 


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

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


Testing
-------

make check


Thanks,

Chun-Hung Hsiao