> On April 19, 2016, 3:37 p.m., Neil Conway wrote: > > Can we update the docs to describe this behavior? e.g., add a note to > > https://mesos.apache.org/documentation/latest/endpoints/ describing the > > redirect behavior -- I suppose it is worth adding a note to every master > > endpoint's doc page describing the redirect behavior, as well as a note to > > the "Master Endpoints" section of the top-level endpoints doc. Might also > > be worth adding a note to the "Operational Guide" or "High Availability" > > pages. We also need to update the docs for the "master/redirect/" endpoint. > > > > This change requires one or more test cases. For example: (a) normal > > redirect case (b) return ServiceUnavailable when there is no leading master > > (c) avoiding redirect loop for `/redirect` endpoint. > > haosdent huang wrote: > Thank you very much for your review. Let me update. > > haosdent huang wrote: > @neilc, I just updated the testing done field. Because we could not > create multiple masters test cases now, I test this manually. May you review > this again? Thank you in advance.
@haosdent: Ah, right, I remember now why it isn't easy to add test cases. How painful would it be to test this by forking multiple processes and running one master per child process? - Neil ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34646/#review129545 ----------------------------------------------------------- On April 22, 2016, 7:18 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34646/ > ----------------------------------------------------------- > > (Updated April 22, 2016, 7:18 a.m.) > > > Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, > Neil Conway, and Vinod Kone. > > > Bugs: MESOS-1865 > https://issues.apache.org/jira/browse/MESOS-1865 > > > Repository: mesos > > > Description > ------- > > In this changes, we redirect to the leading master in those http > endpoints which depend on master elected status if current master is > not the leader. > > > Diffs > ----- > > src/master/http.cpp de06985cafc93022fffc0d13812a119ae43b7e57 > > Diff: https://reviews.apache.org/r/34646/diff/ > > > Testing > ------- > > localhost:5053 is the leading master. localhost:5054 is another master. > > 1) Test normal redirection. > > In the leader. > > ``` > curl -i http://localhost:5053/master/tasks > HTTP/1.1 200 OK > Date: Thu, 21 Apr 2016 06:57:50 GMT > Content-Length: 12 > Content-Type: application/json > > {"tasks":[]} > ``` > > In non-leader. > > ``` > curl -i http://localhost:5054/master/tasks > HTTP/1.1 307 Temporary Redirect > Date: Thu, 21 Apr 2016 07:00:06 GMT > Location: //localhost:5053/master/tasks > Content-Length: 0 > ``` > > 2) Test the `/redirect`. > > In the leader. > > ``` > curl -i http://localhost:5053/master/redirect > HTTP/1.1 307 Temporary Redirect > Date: Thu, 21 Apr 2016 07:00:53 GMT > Location: //localhost:5053 > Content-Length: 0 > ``` > > In the non-leader. > > ``` > curl -i http://localhost:5054/master/redirect > HTTP/1.1 307 Temporary Redirect > Date: Thu, 21 Apr 2016 07:01:34 GMT > Location: //localhost:5053 > Content-Length: 0 > ``` > > 3) Test the `ServiceUnavailable` (By quit zookeeper). > > In the non-leader(The leader is quit because could not connect to zookeeper). > > ``` > curl -i http://localhost:5053/master/redirect > curl: (7) Failed connect to localhost:5053; Connection refused > curl -i http://localhost:5054/master/redirect > HTTP/1.1 503 Service Unavailable > Date: Thu, 21 Apr 2016 07:02:38 GMT > Content-Length: 17 > > No leader elected > ``` > > > Thanks, > > haosdent huang > >
