Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-4782

Error in getting host components with state INSTALL_FAILED

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0
    • 2.1.0
    • ambari-server, test
    • None

    Description

      The problem

      When try to get query on api/v1/clusters/<clustername>/host_components?HostRoles/state=INSTALL_FAILED

      Response is

      { "status" : 400, "message" : "Invalid Request: Invalid arguments, invalid desired state, desiredState=INSTALL_FAILED" }

      This issue is rooted at the over all issue Ambari has where when "state" is specified in the API requests it is always interpreted as "desired_state". And INSTALL_FAILED is an invalid "desired_state". Just fixing the GET calls to interpret request:state as "state" (current state of a host component) might be the right thing to do but will make the get calls to behave differently than other calls. For example, request to set all component which are in INSTALL_FAILED state to INIT (or MAINTENANCE) will not work as expected.

      The proposal:

      The fix is to distinguish between "current_state" and "desired_state" and promote "current_state" as a first class query parameter. "state" query parameter will be still mapped to "desired_state" to maintain backward compatibility.

      Attachments

        1. AMBARI-4782.patch
          26 kB
          Vitaly Brodetskyi

        Issue Links

          Activity

            People

              vbrodetskyi Vitaly Brodetskyi
              dmitriusan Dmitry Lysnichenko
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: