Bug 1019749 - Re-run oo-admin-upgrade for gear with haproxy cartridge will always report fail since the gear-registry.db does not exist anymore
Re-run oo-admin-upgrade for gear with haproxy cartridge will always report fa...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan Mace
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-16 06:53 EDT by Meng Bo
Modified: 2015-05-14 19:30 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 22:24:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2013-10-16 06:53:27 EDT
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@redhat.com --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 11:46:19 EDT
https://github.com/openshift/li/pull/2008
Comment 2 openshift-github-bot 2013-10-18 12:55:37 EDT
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 05:21:50 EDT
Tested on devenv_3921, on the 2nd time upgrade gears after archived. 
It will not check the gear_registry.db.

Move bug to verified.

Note You need to log in before you can comment on or make changes to this bug.