Steven Schlansker created MESOS-1865:
----------------------------------------

             Summary: Mesos APIs for non-leading masters should return copies 
of the leader's state or an error, not a success with incorrect information
                 Key: MESOS-1865
                 URL: https://issues.apache.org/jira/browse/MESOS-1865
             Project: Mesos
          Issue Type: Bug
          Components: json api
    Affects Versions: 0.20.1
            Reporter: Steven Schlansker


Some of the API endpoints, for example /master/tasks.json, will return bogus 
information if you query a non-leading master:

{quote}
[steven@Anesthetize:~]% curl 
http://master1.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0     21      0 --:--:-- --:--:-- --:--:--    21
{
  "tasks": []
}
[steven@Anesthetize:~]% curl 
http://master2.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0    105      0 --:--:-- --:--:-- --:--:--   106
{
  "tasks": []
}
[steven@Anesthetize:~]% curl 
http://master3.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 43081  100 43081    0     0   196k      0 --:--:-- --:--:-- --:--:--  196k
{
  "tasks": [
    {
      "executor_id": "",
      "framework_id": "20140724-231003-419644938-5050-1707-0000",
      "id": 
"pp.guestcenterwebhealthmonitor.606cd6ee-4b50-11e4-825b-5212e05f35db",
      "name": 
"pp.guestcenterwebhealthmonitor.606cd6ee-4b50-11e4-825b-5212e05f35db",
      "resources": {
        "cpus": 0.25,
        "disk": 0,
{quote}

This is very hard for end-users to work around.  For example if I query "which 
master is leading" followed by "master: which tasks are running" it is possible 
that the leader fails over in between, leaving me with an incorrect answer and 
no way to know that this happened.

In my opinion the API should return the correct response (by asking the current 
leader?) or an error (500 Not the leader?) but it's unacceptable to return a 
successful wrong answer.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to