ha broker service should check if metadate file exist upon starting. if not exist - should give a warning message and fail to start.
The HA agent can't check for the files directly. It uses the broker for that. And the broker does not know the service name (and thus the filename) until the agent asks for the metadata. So after a discussion with Doron we decided to implement a 3-strike rule. If the agent tries to execute a call through the broker and sees three failures in a row then the agent will terminate.
Greg, do you think that is a reasonable behaviour? It will wait for a total of three minutes to recover. The other hosts won't see any updates from this one for that time.
I think it's reasonable. With the patch, the agent will exit after 3 successive failures of most anything. I don't immediately see a problem, but we should consider possible temporary failures and whether it's okay for them to effectively kill the agent. Long-term we could consider an environment-checking routine, but for now I don't really see a big advantage in implementing that.
Merged Change-Id: Ia5ec6935673133af2e60f339b035dba3438b617f
Can you please more explicit describe steps for verification of this bug.
(In reply to Artyom from comment #6) > Can you please more explicit describe steps for verification of this bug. 1. See that ha-agent successfully starts after regular installation. 2.Delete metadata file and start the engine. It should be terminated after 3 minutes. Check agent.log file.
sorry,in step 2 start the ha agent (not engine).
Verified on ovirt-hosted-engine-ha-0.1.0-0.3.1.beta1.el6ev.noarch After deleting metadata engine stop working and in log appear message: Full response: failure failed to write metadata: [Errno 2] No such file or directory: '/rhev/data-center/mnt/lion.qa.lab.tlv.redhat.com:_export_alukiano_host__deploy/db1206d1-060b-446f-ad9f-aca7ca23704b/ha_agent/hosted-engine.metadata'
This bug is currently attached to errata RHEA-2013:15591. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag. Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information: * Cause: What actions or circumstances cause this bug to present. * Consequence: What happens when the bug presents. * Fix: What was done to fix the bug. * Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore') Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug. For further details on the Cause, Consequence, Fix, Result format please refer to: https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes Thanks in advance.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-0080.html