Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server state incorrectly reported #987

Merged
merged 1 commit into from
Apr 18, 2017

Conversation

israel-hdez
Copy link
Member

@israel-hdez israel-hdez commented Apr 10, 2017

Server state was being reported based only on inventory data. This will
report server state based on a combination of inventory data and
availability metrics, if EMS/provider features it.

https://bugzilla.redhat.com/show_bug.cgi?id=1438816

This PR goes together with ManageIQ/manageiq-providers-hawkular#6. Merge order is not important and is not required to merge simultaneously.

When server is running, inventory state is reported:
screenshot from 2017-04-10 13-23-23

When server is down, availability metric state is reported:
screenshot from 2017-04-10 13-23-32

@israel-hdez
Copy link
Member Author

@rubenvp8510 can you review?

@israel-hdez
Copy link
Member Author

@miq-bot add_label middleware

@dclarizio
Copy link

@israel-hdez from what I can tell, the BZ is upstream only, so I labeled as fine/no . . . let me know if this is not the case. Thx, Dan

@dclarizio dclarizio self-assigned this Apr 11, 2017
@abonas
Copy link
Member

abonas commented Apr 12, 2017

@israel-hdez from what I can tell, the BZ is upstream only, so I labeled as fine/no . . . let me know if this is not the case. Thx, Dan

@dclarizio why do you think the BZ is upstream only?

@abonas
Copy link
Member

abonas commented Apr 12, 2017

@israel-hdez so the "Calculated" is coming from metrics? what if both are non empty? is it correct to take the first one?

@dclarizio
Copy link

@abonas

@dclarizio why do you think the BZ is upstream only?

Not sure, I would think any upstream bugs would at least go back to Fine release. Maybe check with the reporter to see if they forgot to set the release field.

@israel-hdez
Copy link
Member Author

so the "Calculated" is coming from metrics? what if both are non empty? is it correct to take the first one?

@abonas Indeed, both values should be non empty most times. The "Calculated" is a combination of the availability metric and the state reported by inventory ("Server State"):

  • If availability metric reports "up" value, then "Calculated" will be the same as "Server State" reported by inventory (value will be either "starting", "running" or "restart required")
  • Else, then "Calculated" will take the value of the availability metric (either "Down" or "Unknown").

I understand that the UI is provider generic, so I kept both fields. This way, if some other middleware provider doesn't need to "calculate" the server status, it can just fill the "server status". But given that right now, hawkular is the only middleware provider, it will always take the first value. If this is noisy, I can just keep the "calculated" one.

@abonas
Copy link
Member

abonas commented Apr 13, 2017

@israel-hdez can you put a short comment in the git commit that will explain what you explained so greatly above? your comment here won't be part of git log, so I'd like the explanation to be captured for whoever looks at the code and the commit why it is written that way.
after that, I hope to see it merged soon cc @dclarizio

@abonas
Copy link
Member

abonas commented Apr 13, 2017

@miq-bot add_label fine/yes

@abonas
Copy link
Member

abonas commented Apr 13, 2017

@miq-bot remove_label fine/no

@miq-bot miq-bot removed the fine/no label Apr 13, 2017
@dclarizio
Copy link

@israel-hdez @abonas re-ping me when the commit message is changed as this looks ready for merge.

Hawkular's provider was reporting server state based only on inventory
data, which is misleading when server is down. To fix this, a
"calculated" field is added to the properties. The availability metric
of the server is used to determine what value will have the "calculated"
field:

- When the availability metric reports that the server is "up", the
  "calculated" field will mirror the "Server State" field.
- If the availability metric reports something else than "up", the
  "calculated" field will mirror the value of the availability metric.

Hawkular provider will always fill the "calculated" field, and the UI
will always show its value. If some other middleware provider does not
need to use a "calculated" server status, it can leave it unassigned and
the UI will show the "Server Satus" field.

https://bugzilla.redhat.com/show_bug.cgi?id=1438816
@miq-bot
Copy link
Member

miq-bot commented Apr 17, 2017

Checked commit israel-hdez@29e5626 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. ⭐

@israel-hdez
Copy link
Member Author

@dclarizio The comment of the git commit is in place. Now, you can merge.

@dclarizio dclarizio merged commit 9a70448 into ManageIQ:master Apr 18, 2017
@dclarizio dclarizio added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 18, 2017
simaishi pushed a commit that referenced this pull request Apr 19, 2017
Fix server state incorrectly reported
(cherry picked from commit 9a70448)
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit f5e6cc0b2f533fb4da406470312d802f10f8609c
Author: Dan Clarizio <dclarizi@redhat.com>
Date:   Tue Apr 18 02:10:39 2017 -0700

    Merge pull request #987 from israel-hdez/BZ-1438816
    
    Fix server state incorrectly reported
    (cherry picked from commit 9a704488ac200d92f8458fd7e387e8d88ff1a572)

@israel-hdez israel-hdez deleted the BZ-1438816 branch April 20, 2017 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants