> On Jan. 9, 2016, 5:02 p.m., Klaus Ma wrote:
> > src/master/master.cpp, line 3078
> > <https://reviews.apache.org/r/42086/diff/2/?file=1189007#file1189007line3078>
> >
> >     If both `offerError.isSome()` and `inverseOfferError.isSome()`, should 
> > we return `Error()`?
> 
> Joseph Wu wrote:
>     What do you mean?  (This method has a `void` return type.)

I'm thinking what's the behaviour when both offer & inverseOffer failed at 
validation. Just re-check the code, it behaviour is recoverResources, right?


> On Jan. 9, 2016, 5:02 p.m., Klaus Ma wrote:
> > src/master/master.cpp, line 3122
> > <https://reviews.apache.org/r/42086/diff/2/?file=1189007#file1189007line3122>
> >
> >     Why did we check `inverseOfferError.isSome()`? inverseOffer should be 
> > handled before.
> 
> Joseph Wu wrote:
>     `Master::accept` will process multiple Offers at once, but if there is 
> any error, we reject the entire set of offers.  That's why we check both 
> errors here.
>     
>     I'll reword a few comments to make this more explicit.

For this one, I'd suggest to hanlde inverseOffer's case in its loop; current 
code logic is handling inverseOffer, then handling offers and if there's 
inverseOffer, also handle it (recoverResource).


- Klaus


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


On Jan. 12, 2016, 5:31 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42086/
> -----------------------------------------------------------
> 
> (Updated Jan. 12, 2016, 5:31 a.m.)
> 
> 
> Review request for mesos, Ben Mahler, Artem Harutyunyan, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4301
>     https://issues.apache.org/jira/browse/MESOS-4301
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds `validation::offer::inverse::validate` to validate inverse offers along 
> the same lines as `validation::offer::validate`, except `SlaveId` is not 
> validated for inverse offers.
> 
> Fixes and refactors `Master::accept` to allow `ACCEPT` calls that contain 
> both offers and inverse offers.
> Also tweaks `Master::accept` to not print a misleading log line "ACCEPT call 
> used invalid offers ..." when the call only includes inverse offers.
> 
> 
> Diffs
> -----
> 
>   include/mesos/type_utils.hpp efe2b1de0c277db62d7f7cc5ff1cd9143b9f632a 
>   src/common/type_utils.cpp 76f48f6a1f5467db032ded8acd296d03353b4172 
>   src/master/master.hpp f02d165874fa8023675e545793de699aeecae29b 
>   src/master/master.cpp 2d9b7f9540574aa3ef9e5af3b2b8922dffeebac8 
>   src/master/validation.hpp 380b40279faf180a6f401a5e28280b601dbc648c 
>   src/master/validation.cpp 6a43bce5b7df6a9d939245c4726d060fa19eb305 
> 
> Diff: https://reviews.apache.org/r/42086/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> # Ran the following and checked for blank output:
> bin/mesos-tests.sh --gtest_filter="*Inverse*Offer*" --verbose 2>&1 /dev/null 
> |  grep "ACCEPT call used invalid offers"
> 
> # Check new test for flakiness:
> bin/mesos-tests.sh --gtest_filter="*OffersAndInverseOffers" 
> --gtest_repeat=1500 --gtest_break_on_failure
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>

Reply via email to