Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-1865

Redirect to the leader master when current master is not a leader

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.1
    • Fix Version/s: 1.0.0
    • Component/s: json api
    • Labels:
      None
    • Sprint:
      Mesosphere Sprint 33
    • Story Points:
      3

      Description

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

      [steven@Anesthetize:~]% curl http://master1.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
      {
        "tasks": []
      }
      [steven@Anesthetize:~]% curl http://master2.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
      {
        "tasks": []
      }
      [steven@Anesthetize:~]% curl http://master3.mesos-vpcqa.otenv.com:5050/master/tasks.json | jq . | head -n 10
      {
        "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,
      

      This is very hard for end-users to work around. For example if I query "which master is leading" followed by "leader: 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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                haosdent@gmail.com haosdent
                Reporter:
                stevenschlansker Steven Schlansker
                Shepherd:
                Vinod Kone
              • Votes:
                2 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: