You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by haosdent huang <ha...@gmail.com> on 2016/04/21 06:09:16 UTC

Re: Review Request 34646: Redirected to the leader master when current master is not the leader.

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

(Updated April 21, 2016, 4:09 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Address @neilc's comments.


Summary (updated)
-----------------

Redirected to the leader master when current master is not the leader.


Bugs: MESOS-1865
    https://issues.apache.org/jira/browse/MESOS-1865


Repository: mesos


Description (updated)
-------

In this changes, we redirect to the leader master in those http
endpoints which depend on master elected status if current master is
not the leader.


Diffs (updated)
-----

  src/master/http.cpp a9cb99a92ff5a783e719df5e5cfb6e8301241df9 

Diff: https://reviews.apache.org/r/34646/diff/


Testing
-------

make check

when current master is not a leader, it would redirect to the leader master.

```
$ curl -i http://master1:5050/master/tasks.json
HTTP/1.1 307 Temporary Redirect
Date: Mon, 01 Jun 2015 06:30:08 GMT
Location: http://master2:5050//master/tasks.json
Content-Length: 0
```


Thanks,

haosdent huang


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/#review130003
-----------------------------------------------------------


Ship it!




Ship It!

- Vinod Kone


On April 21, 2016, 7:04 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34646/
> -----------------------------------------------------------
> 
> (Updated April 21, 2016, 7:04 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 a9cb99a92ff5a783e719df5e5cfb6e8301241df9 
> 
> 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
> 
>


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 22, 2016, 4:39 p.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Rebase.


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 (updated)
-----

  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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 22, 2016, 3:47 p.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Rebase.


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 (updated)
-----

  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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
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.


Changes
-------

Fix style error and rebase.


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 (updated)
-----

  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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 22, 2016, 4:17 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Rebase


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 (updated)
-----

  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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 21, 2016, 7:04 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Update test field


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 a9cb99a92ff5a783e719df5e5cfb6e8301241df9 

Diff: https://reviews.apache.org/r/34646/diff/


Testing (updated)
-------

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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 21, 2016, 7:04 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Update test cases.


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 a9cb99a92ff5a783e719df5e5cfb6e8301241df9 

Diff: https://reviews.apache.org/r/34646/diff/


Testing (updated)
-------

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
[ld-huangh@airpay-spare-4 ~]$ 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


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 21, 2016, 4:13 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Changes
-------

Update description.


Bugs: MESOS-1865
    https://issues.apache.org/jira/browse/MESOS-1865


Repository: mesos


Description (updated)
-------

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 a9cb99a92ff5a783e719df5e5cfb6e8301241df9 

Diff: https://reviews.apache.org/r/34646/diff/


Testing
-------

make check

when current master is not a leader, it would redirect to the leader master.

```
$ curl -i http://master1:5050/master/tasks.json
HTTP/1.1 307 Temporary Redirect
Date: Mon, 01 Jun 2015 06:30:08 GMT
Location: http://master2:5050//master/tasks.json
Content-Length: 0
```


Thanks,

haosdent huang


Re: Review Request 34646: Redirected to the leading master when current master is not the leader.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34646/
-----------------------------------------------------------

(Updated April 21, 2016, 4:11 a.m.)


Review request for mesos, Adam B, Anand Mazumdar, Cody Maloney, Ian Downes, Neil Conway, and Vinod Kone.


Summary (updated)
-----------------

Redirected to the leading master when current master is not the leader.


Bugs: MESOS-1865
    https://issues.apache.org/jira/browse/MESOS-1865


Repository: mesos


Description
-------

In this changes, we redirect to the leader master in those http
endpoints which depend on master elected status if current master is
not the leader.


Diffs
-----

  src/master/http.cpp a9cb99a92ff5a783e719df5e5cfb6e8301241df9 

Diff: https://reviews.apache.org/r/34646/diff/


Testing
-------

make check

when current master is not a leader, it would redirect to the leader master.

```
$ curl -i http://master1:5050/master/tasks.json
HTTP/1.1 307 Temporary Redirect
Date: Mon, 01 Jun 2015 06:30:08 GMT
Location: http://master2:5050//master/tasks.json
Content-Length: 0
```


Thanks,

haosdent huang