> On May 31, 2016, 12:06 a.m., Qian Zhang wrote: > > src/master/http.cpp, line 1205 > > <https://reviews.apache.org/r/48049/diff/4/?file=1401329#file1401329line1205> > > > > I think we are trying to get leading master here, so should we return > > `master->leader.get()`? > > Anand Mazumdar wrote: > We won't ever reach here if the current master is not the leader owing > to: https://github.com/apache/mesos/blob/master/src/master/http.cpp#L361 > > Hence, doing `master->info()` is fine. > > For posterity though, let's add an explicit comment and an invariant > check: > > ```cpp > // It is guaranteed that this master has been elected as the leader. > CHECK(master->elected()); > > response.mutable_get_leading_master()->mutable_master_info()->CopyFrom( > evolve(master->info())); > ```
Though CHECK(master->elected()) is called before calling getLeadingMaster, still I explicitly added againg inside getLeadingMaster. - Abhishek ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/48049/#review135563 ----------------------------------------------------------- On May 31, 2016, 6:32 a.m., Abhishek Dasgupta wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/48049/ > ----------------------------------------------------------- > > (Updated May 31, 2016, 6:32 a.m.) > > > Review request for mesos, Anand Mazumdar and Vinod Kone. > > > Bugs: MESOS-5497 > https://issues.apache.org/jira/browse/MESOS-5497 > > > Repository: mesos > > > Description > ------- > > Implemented GET_LEADING_MASTER Call in v1 master API and > made a minor change in the test case for GET_LOGGING_LEVEL. > > > Diffs > ----- > > src/internal/evolve.hpp 0fdda31 > src/internal/evolve.cpp 4f25f1a > src/master/http.cpp c8d2f46 > src/master/master.hpp eeeccdf > src/tests/api_tests.cpp 0b6bfad > > Diff: https://reviews.apache.org/r/48049/diff/ > > > Testing > ------- > > On Ubuntu 16.04: > > sudo GTEST_FILTER="*MasterAPITest*.*" make -j2 check > > > Thanks, > > Abhishek Dasgupta > >