----------------------------------------------------------- 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) <https://reviews.apache.org/r/67863/#comment288885> 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<Operation>` functions which we could reduce a bit. src/master/master.hpp Lines 935-937 (original), 935-937 (patched) <https://reviews.apache.org/r/67863/#comment288887> See above, lets have a single `authorizeDestroyDisk` instead of `authorizeDestroyMountDisk` and `authorizeDestroyBlockDisk`. src/master/master.cpp Lines 4634-4651 (original), 4628-4643 (patched) <https://reviews.apache.org/r/67863/#comment288888> 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) <https://reviews.apache.org/r/67863/#comment288890> 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) <https://reviews.apache.org/r/67863/#comment288889> Ditto. src/master/master.cpp Lines 4667 (patched) <https://reviews.apache.org/r/67863/#comment288891> 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) <https://reviews.apache.org/r/67863/#comment288892> 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) <https://reviews.apache.org/r/67863/#comment288893> 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 > >
