Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-13 Thread Chun-Hung Hsiao

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

(Updated July 13, 2018, 6:39 p.m.)


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


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


Repository: mesos


Description
---

This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
`CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
`DESTROY_DISK` operations.


Diffs (updated)
-

  src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
  src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
  src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
  src/master/master.cpp 487ee349ef0cd78903ff6bcdea3f24688810cdc5 
  src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
  src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
  src/resource_provider/storage/provider.cpp 
b90a4b81838fec410a97a10ce44a811bb81c87eb 


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

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


Testing
---

make

Tests done later in chain.


Thanks,

Chun-Hung Hsiao



Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-13 Thread Chun-Hung Hsiao

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

(Updated July 13, 2018, 6:27 p.m.)


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


Changes
---

Addressed some of Jan's comments.


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


Repository: mesos


Description
---

This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
`CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
`DESTROY_DISK` operations.


Diffs (updated)
-

  src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
  src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
  src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
  src/master/master.cpp 487ee349ef0cd78903ff6bcdea3f24688810cdc5 
  src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
  src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
  src/resource_provider/storage/provider.cpp 
b90a4b81838fec410a97a10ce44a811bb81c87eb 


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

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


Testing
---

make

Tests done later in chain.


Thanks,

Chun-Hung Hsiao



Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-13 Thread Jan Schlicht

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


Fix it, then Ship it!





src/master/validation.cpp
Line 2529 (original), 2529 (patched)


s/target/source/

Here and below.



src/resource_provider/storage/provider.cpp
Line 2759 (original), 2757 (patched)


Not yours, but s/returns/return/.



src/resource_provider/storage/provider.cpp
Line 3249 (original), 3223 (patched)


Shouldn't this case result in a `Failure`?


- Jan Schlicht


On July 12, 2018, 6:55 a.m., Chun-Hung Hsiao wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67863/
> ---
> 
> (Updated July 12, 2018, 6:55 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9066
> https://issues.apache.org/jira/browse/MESOS-9066
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
> `CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
> `DESTROY_DISK` operations.
> 
> 
> Diffs
> -
> 
>   src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
>   src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
>   src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
>   src/master/master.cpp 487ee349ef0cd78903ff6bcdea3f24688810cdc5 
>   src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
>   src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
>   src/resource_provider/storage/provider.cpp 
> b90a4b81838fec410a97a10ce44a811bb81c87eb 
> 
> 
> Diff: https://reviews.apache.org/r/67863/diff/2/
> 
> 
> Testing
> ---
> 
> make
> 
> Tests done later in chain.
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>



Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-11 Thread Chun-Hung Hsiao

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

(Updated July 12, 2018, 4:55 a.m.)


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


Changes
---

Addressed Jan's comments.


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


Repository: mesos


Description (updated)
---

This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
`CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
`DESTROY_DISK` operations.


Diffs (updated)
-

  src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
  src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
  src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
  src/master/master.cpp 487ee349ef0cd78903ff6bcdea3f24688810cdc5 
  src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
  src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
  src/resource_provider/storage/provider.cpp 
b90a4b81838fec410a97a10ce44a811bb81c87eb 


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

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


Testing
---

make

Tests done later in chain.


Thanks,

Chun-Hung Hsiao



Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-11 Thread Chun-Hung Hsiao


> On July 11, 2018, 10:28 a.m., Jan Schlicht wrote:
> > src/master/master.cpp
> > Lines 4642 (patched)
> > 
> >
> > We should log a warning and break here, not crash. The operation isn't 
> > fully validated at this point. Full validation is done in `_accept`.

Thanks for pointing this out! This is a really stupid and dangerous bug :(


- Chun-Hung


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


On July 10, 2018, 3:11 a.m., Chun-Hung Hsiao wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67863/
> ---
> 
> (Updated July 10, 2018, 3:11 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9066
> https://issues.apache.org/jira/browse/MESOS-9066
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
> `CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
> `DESTROY_DISK` operations.
> 
> Note that in SLRP we made CHECKs against disk types instead of returning
> failures, Since the disk types should have been validated by the master.
> 
> 
> Diffs
> -
> 
>   src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
>   src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
>   src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
>   src/master/master.cpp 0c0d6ca375b806a02625261f7e272a126bc4debe 
>   src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
>   src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
>   src/resource_provider/storage/provider.cpp 
> b90a4b81838fec410a97a10ce44a811bb81c87eb 
> 
> 
> Diff: https://reviews.apache.org/r/67863/diff/1/
> 
> 
> Testing
> ---
> 
> make
> 
> Tests done later in chain.
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>



Re: Review Request 67863: Updated Mesos implementation to process `CREATE_DISK` & `DESTROY_DISK`.

2018-07-11 Thread Jan Schlicht

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




src/master/master.hpp
Lines 914-916 (original), 914-916 (patched)


How about we have a single `authorizeCreateDisk` that takes an additional 
`target` parameter and uses that to determine the authorization action from 
that?
There's a lot of code duplication in all the `authorize` 
functions which we could reduce a bit.



src/master/master.hpp
Lines 935-937 (original), 935-937 (patched)


See above, lets have a single `authorizeDestroyDisk` instead of 
`authorizeDestroyMountDisk` and `authorizeDestroyBlockDisk`.



src/master/master.cpp
Lines 4634-4651 (original), 4628-4643 (patched)


See above: With a single `authorizeCreateDisk` we wouldn't need this switch 
here. There would be a similar switch in the authorize function to choose the 
authorization action.



src/master/master.cpp
Lines 4642 (patched)


We should log a warning and break here, not crash. The operation isn't 
fully validated at this point. Full validation is done in `_accept`.



src/master/master.cpp
Lines 4670-4672 (original), 4653-4668 (patched)


Ditto.



src/master/master.cpp
Lines 4667 (patched)


We should log a warning and break here, not crash. The operation isn't 
fully validated at this point. Full validation is done in `_accept`.



src/resource_provider/storage/provider.cpp
Line 3067 (original), 3047 (patched)


Why change the `Failure` to a `CHECK_EQ` here? I don't see how this 
functional change fits into the scope of this diff. Maybe break this out into a 
separate diff?



src/resource_provider/storage/provider.cpp
Lines 3248-3249 (original), 3218-3219 (patched)


Ditto.


- Jan Schlicht


On July 10, 2018, 5:11 a.m., Chun-Hung Hsiao wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67863/
> ---
> 
> (Updated July 10, 2018, 5:11 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jie Yu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-9066
> https://issues.apache.org/jira/browse/MESOS-9066
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch removes the code for `CREATE_VOLUME`, `DESTROY_VOLUME`,
> `CREATE_BLOCK` and `DESTROY_BLOCK` to adapt the new `CREATE_DISK` and
> `DESTROY_DISK` operations.
> 
> Note that in SLRP we made CHECKs against disk types instead of returning
> failures, Since the disk types should have been validated by the master.
> 
> 
> Diffs
> -
> 
>   src/common/protobuf_utils.cpp 82ba141fca86f5926dc519060c35308026c6048f 
>   src/common/resources_utils.cpp eb7299583c197dd0e44c1c63417206b5c59ab853 
>   src/master/master.hpp 2ce71dca52245b41533728a7564c65daa135b224 
>   src/master/master.cpp 0c0d6ca375b806a02625261f7e272a126bc4debe 
>   src/master/validation.hpp 1ba6d6530d916b5c06762ee2b0bc91b819cd10e5 
>   src/master/validation.cpp 79c67c3c409f03e94f1b5956fd035cd388ab0c3b 
>   src/resource_provider/storage/provider.cpp 
> b90a4b81838fec410a97a10ce44a811bb81c87eb 
> 
> 
> Diff: https://reviews.apache.org/r/67863/diff/1/
> 
> 
> Testing
> ---
> 
> make
> 
> Tests done later in chain.
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>