Bug 1036710

Summary: HA agent should behave appropriately when newer metadata is encountered
Product: Red Hat Enterprise Virtualization Manager Reporter: Greg Padgett <gpadgett>
Component: ovirt-hosted-engine-haAssignee: Greg Padgett <gpadgett>
Status: CLOSED ERRATA QA Contact: Artyom <alukiano>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: amureini, dfediuck, gpadgett, iheim, mavital, sbonazzo, sherold
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: ovirt-hosted-engine-ha-0.1.0-0.8.rc.el6ev Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 16:51:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Greg Padgett 2013-12-02 13:59:05 UTC
Description of problem:
Future HA agents may use metadata that's incompatible with the current agents.  The current and new agents should handle this case, which requires some modifications in the current agent.

This will be a change in the code that will affect operation only if newer metadata is on the shared storage, but otherwise won't affect HA behavior.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Greg Padgett 2013-12-03 14:24:29 UTC
Merged Change-Id: I2357ce26aeb20439dec161c7b8ee46d94a4b3e3d

Comment 3 Artyom 2013-12-08 09:25:58 UTC
Please provide correct information for bug reproducing.
Thanks

Comment 4 Greg Padgett 2013-12-09 17:22:41 UTC
2 parts of this can be tested now:
a) the agent should function normally with this fix (i.e. no false "metadata too new" errors)
b) the agent should stop if newer metadata is encountered.

For part b, you need to fake some newer metadata:

1) Identify the path to the shared storage holding the engine vm (it should be in the agent log file, or derived from /etc/ovirt-hosted-engine/engine.conf)

2) Write a byte representing a newer version to the file.
   Note 1: You want to do this in a blank metadata slot, so the seek= argument should equal (4096 * (max_host_id + 1)).  I.e. if you have 2 hosts, host_id 1 and 2, you'd seek 12288 bytes.
   Note 2: The file below should already exist; if not, check your sd path
   Note 3: The "echo -n '3'" always uses 3... no relation to host ids
Use the value from above and run the command below, all one line, to fake some newer metadata:

echo -n '3' | dd conv=notrunc of=/<path to domain>/ha_agent/hosted-engine.metadata bs=1 count=1 seek=<your offset, e.g. 12288>

Any running agents should shortly start displaying log messages that they are no longer performing any actions on the engine VM because a newer agent/metadata was detected.

When done, you can remove the spoofed metadata version using the following, substituting as necessary to match your command above:

dd conv=notrunc if=/dev/zero of=/<path to domain>/ha_agent/hosted-engine.metadata bs=1 count=1 seek=<your offset, e.g. 12288>

Comment 5 Artyom 2013-12-12 14:52:27 UTC
Verified on ovirt-hosted-engine-ha-0.1.0-0.8.rc.el6ev.noarch
1) No errors of type metadata too new
2) After updating metadata, vm shutdown and I have message in log "Local agent has been superseded by newer agents running in this cluster"

Comment 6 errata-xmlrpc 2014-01-21 16:51:48 UTC
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