Bug 1019749

Summary: Re-run oo-admin-upgrade for gear with haproxy cartridge will always report fail since the gear-registry.db does not exist anymore
Product: OpenShift Online Reporter: Meng Bo <bmeng>
Component: ContainersAssignee: Dan Mace <dmace>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmace, jhonce, pmorie
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:24:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Meng Bo 2013-10-16 10:53:27 UTC
Description of problem:
Upgrade the gear may be fail with partial migration, when trying to re-run upgrade gear with haproxy cartridge exist will always report fail since the haproxy/conf/gear-registry.db does not exist.

We should skip the "migrate_gear_registry" if the haproxy cartridge was already upgraded.

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

How reproducible:
always

Steps to Reproduce:
1. Create apps on devenv-stage_496
2. Upgrade the server and migrate the datastore 
3. Upgrade gears with oo-admin-upgrade
#oo-admin-upgrade upgrade-node --version 2.0.35 --ignore-cartridge-version
4. Re-run upgrade on the gears with haproxy cartridge

Actual results:
# oo-admin-upgrade upgrade-gear --version 2.0.35 --login bmeng --app-name php1s --ignore-cartridge-version --upgrade-gear 525e328bb39175ead6000063

...
            "upgrade_gear_registry": {
                "context": {}, 
                "errors": [
                    "Unhandled exception performing step: No such file or directory - /var/lib/openshift/525e328bb39175ead6000063/haproxy/conf/gear-registry.db\n/usr/libexec/openshift/lib/gear_upgrade_extension.rb:131:in `read'\n/usr/libexec/openshift/lib/gear_upgrade_extension.rb:131:in `block in migrate_gear_registry'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/utils/upgrade_progress.rb:32:in `step'\n/usr/libexec/openshift/lib/gear_upgrade_extension.rb:126:in `migrate_gear_registry'\n/usr/libexec/openshift/lib/gear_upgrade_extension.rb:53:in `pre_cartridge_upgrade'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/upgrade.rb:345:in `block in pre_cartridge_upgrade'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/utils/upgrade_progress.rb:32:in `step'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/upgrade.rb:344:in `pre_cartridge_upgrade'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/upgrade.rb:381:in `upgrade_cartridges'\n/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/upgrade.rb:159:in `execute'\n/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:243:in `upgrade_action'\n/opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/agent.rb:86:in `handlemsg'\n/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:126:in `block (2 levels) in dispatch'\n/opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'\n/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:125:in `block in dispatch'"
                ], 
                "status": "incomplete"

...


Expected results:
Should skip the upgrade_gear_registry if the haproxy cartridge was already upgraded.

Additional info:

Comment 1 Dan Mace 2013-10-18 15:46:19 UTC
https://github.com/openshift/li/pull/2008

Comment 2 openshift-github-bot 2013-10-18 16:55:37 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/0030213145cafb26f17a4f38ce98963781a6e491
Bug 1019749: Make migrate_gear_registry reentrant

Comment 3 Meng Bo 2013-10-21 09:21:50 UTC
Tested on devenv_3921, on the 2nd time upgrade gears after archived. 
It will not check the gear_registry.db.

Move bug to verified.