mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Allen <char...@allen-net.com>
Subject Re: Review Request 52105: Add smarter master redirects.
Date Wed, 21 Sep 2016 23:41:06 GMT


> On Sept. 21, 2016, 3:18 p.m., haosdent huang wrote:
> > Hi, @drcrallen Thanks a lot for your patch!
> > 
> > I saw your patch try to redirect `http://SOME_MASTER:5050/master/redirect/master/frameworks`
to `http://LEADER_MASTER:5050/master/frameworks`. Could you elaborate the user cases about
this? Because we have handled the endpoint redirection automatically internal. For example,
when you request `http://NON_LEADING_MASTER:5050/master/frameworks`, mesos master would redirect
to `http://LEADING_MASTER:5050/master/frameworks`.

That comes from two things:

1. http://mesos.apache.org/documentation/latest/endpoints/master/redirect/ suggests using
redirect as a UI bookmarking mechanism, as such, it seemed reasonable for other calls to be
able to redirect through the same mechanism. This might be a left-over suggestion from pre-1.0
though. An alternative thing here would be to update the redirect docs to remove the suggestion
for UI bookmarking if it is no longer required.
2. That's how some other internal discovery mechanism are setup here, so I kind of expected
http://SOME_MASTER:5050/master/redirect/state to redirect to the master and get the cluster
state. But if the non-leading masters should redirect to the leading masters then I don't
think that is helpful anymore, and I think that behavior changed with 1.0?


- Charles


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


On Sept. 21, 2016, 3:03 a.m., Charles Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52105/
> -----------------------------------------------------------
> 
> (Updated Sept. 21, 2016, 3:03 a.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Bugs: MESOS-6210
>     https://issues.apache.org/jira/browse/MESOS-6210
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add smarter master redirects.
> 
> 
> Diffs
> -----
> 
>   docs/endpoints/master/redirect.md 3387b64c32fe394949863cbcb3e2b58be1b00bd0 
>   src/master/http.cpp 9005e7c308d5f57c6f5c573951d468a3ba730740 
> 
> Diff: https://reviews.apache.org/r/52105/diff/
> 
> 
> Testing
> -------
> 
> Single Node started with `./src/mesos-master --work_dir=/tmp/mesos`
> 
> 
> ```
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/redirect
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /redirect HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 307 Temporary Redirect
> < Date: Tue, 20 Sep 2016 23:12:24 GMT
> < Location: //10.17.97.185:5050
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/redirect/foo
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /redirect/foo HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 307 Temporary Redirect
> < Date: Tue, 20 Sep 2016 23:12:35 GMT
> < Location: //10.17.97.185:5050/foo
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/master/redirect/test
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /master/redirect/test HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 307 Temporary Redirect
> < Date: Tue, 20 Sep 2016 23:12:49 GMT
> < Location: //10.17.97.185:5050/test
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/master/redirectNOTFOUND/test
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /master/redirectNOTFOUND/test HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 404 Not Found
> < Date: Tue, 20 Sep 2016 23:12:57 GMT
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/master/redirect/
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /master/redirect/ HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 404 Not Found
> < Date: Tue, 20 Sep 2016 23:13:32 GMT
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/master/redirect/test
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0)
> > GET /master/redirect/test HTTP/1.1
> > Host: 127.0.0.1:5050
> > User-Agent: curl/7.43.0
> > Accept: */*
> >
> < HTTP/1.1 307 Temporary Redirect
> < Date: Tue, 20 Sep 2016 23:13:43 GMT
> < Location: //10.17.97.185:5050/test
> < Content-Length: 0
> <
> * Connection #0 to host 127.0.0.1 left intact
> ```
> 
> It is worth noting that in this PR /master/redirect/  and /redirect/ return 404, not
307. This behavior is consistent with master.
> 
> 
> Thanks,
> 
> Charles Allen
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message