> On Dec. 5, 2013, 9:47 p.m., Jiang Yan Xu wrote: > > LGTM but we should have a subsequent patch to interpret the negative > > numbers in leader election. (e.g. negative numbers are excluded when > > looking for the minimum unless every sequence number in the group is > > negative) > > Ben Mahler wrote: > That would make the overflow case behave in the same way as when we're > entirely in the positive range, but I think it would have to be more involved > to also handle the case where we cross the 0 boundary: > > -3 -2 -1 -> -3 leading > -1 0 1 -> 0 leading since not all negative, in this case -1 will never > get elected if we were to only ignore negative? > > My inclination is to keep this simple, since treating the negatives in a > special way is a bit complicated. Can you think of any bad behavior? > > Jiang Yan Xu wrote: > I agree the only special case is where we cross the 0 boundary. Do you > mean that it's unnecessary to detect the negative numbers at all?
It is unnecessary, but at the overflow boundary it will not perform round-robin election: M1 M2 M3 2^31 -2^31 -2^31+1 ^ | This leader will not gain leadership unless two masters are out of candidacy, or it is killed. This is a little odd, but it is safe. - Ben ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/16045/#review29835 ----------------------------------------------------------- On Dec. 5, 2013, 9:40 p.m., Ben Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/16045/ > ----------------------------------------------------------- > > (Updated Dec. 5, 2013, 9:40 p.m.) > > > Review request for mesos, Benjamin Hindman, Vinod Kone, and Jiang Yan Xu. > > > Bugs: MESOS-867 > https://issues.apache.org/jira/browse/MESOS-867 > > > Repository: mesos-git > > > Description > ------- > > See MESOS-867 for context. > > > Diffs > ----- > > src/zookeeper/group.hpp 27b2ee9433e784ccc5b8809e8e0efe449e1da4ba > src/zookeeper/group.cpp 2ddc65e8655280cc7ff8e23aca561c6ec6e7e1e2 > > Diff: https://reviews.apache.org/r/16045/diff/ > > > Testing > ------- > > make check, also verified that numify<int32_t> works as expected. > > > Thanks, > > Ben Mahler > >
