Bug 971129

Summary: Handle edge-cases for cartridge migration
Product: OpenShift Online Reporter: Paul Morie <pmorie>
Component: ContainersAssignee: Paul Morie <pmorie>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.xCC: bmeng
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: 2013-06-24 14:51:25 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:
Embargoed:

Description Paul Morie 2013-06-05 18:46:21 UTC
While fixing issues that came up during the V1 -> V2 migration in production, we determined a couple edge-cases that need to be accounted for in the cartridge migrations going forward:

1. Gear without cartridges
2. Gear at quota

Comment 1 Paul Morie 2013-06-18 17:29:23 UTC
Only quota handling should be tested for this bug.  The case for a gear without cartridges is covered by https://bugzilla.redhat.com/show_bug.cgi?id=971120

Comment 2 Paul Morie 2013-06-18 21:06:36 UTC
PR submitted to master.

Comment 3 openshift-github-bot 2013-06-19 01:27:45 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/5f09dd6fcba48e99187dca925f399c8e05b0d8d7
Fix bug 971129: enhance quota handling for gears during migration

Comment 4 Paul Morie 2013-06-19 01:29:53 UTC
Quota should be doubled for blocks and/or inodes if usage is above 50%.

Available in devenv 3384.

Comment 5 Meng Bo 2013-06-20 09:11:11 UTC
Checked on devenv_3390,

1. Create app with 700M file in the app-root/data dir.
2. Do migration
3. Will find the quota resetting to 2x during migration and reset back after that.

Migrating app 'quota' gear 'quota' with uuid '44d83d32d97411e2a0e222000a8a2816' on node 'ip-10-138-40-22' for user: bmeng
Migrating gear on node with: /usr/bin/rhc-admin-migrate --login 'bmeng' --migrate-gear '44d83d32d97411e2a0e222000a8a2816' --app-name 'quota' --version '2.0.29' --ignore-cartridge-version
Migrating on node...
***time_migrate_on_node_measured_from_broker=19521***
Migrate on node output:
 Beginning 2.0.29 migration for 44d83d32d97411e2a0e222000a8a2816
Inspecting gear at /var/lib/openshift/44d83d32d97411e2a0e222000a8a2816
Pre-migration state: started
Marking step inspect_gear_state complete
Migrating gear at /var/lib/openshift/44d83d32d97411e2a0e222000a8a2816
Relaxing quota to blocks=2097152, inodes=40000
Refreshing cartridge redhat:ruby:1.9:0.0.2, ignoring cartridge version.
Creating migration instruction validate_gear
Stopping gear with uuid '44d83d32d97411e2a0e222000a8a2816' on node 'ip-10-138-40-22'
Marking step stop_gear complete
Creating migration instruction restart_gear
Incompatible migration of cartridge redhat:ruby:1.9:0.0.2

Marking step ruby_setup complete
Marking step ruby_erb complete
Marking step ruby_connect_frontend complete
Marking step ruby_migrate complete
Marking step ruby_update_ident complete
Starting gear with uuid '44d83d32d97411e2a0e222000a8a2816' on node 'ip-10-138-40-22'
Start gear output: Starting Ruby cart

Marking step start_gear complete
***time_restart=8710***
Resetting quota blocks: 1048576  inodes: 40000
Validating gear 44d83d32d97411e2a0e222000a8a2816 post-migration
Pre-migration state: started
Post-migration response code: 200
Marking step validate_gear complete
Cleaning up after migration
***time_migrate_on_node_measured_from_node=19390***
***time_redeploy_httpd_proxy=0***
***time_restart=0***
***time_total_migrate_gear_measured_from_broker=19533***


After migration check the app:
[quota-bmengdev.dev.rhcloud.com app-root]\> du -sh
701M	.
[quota-bmengdev.dev.rhcloud.com app-root]\> quota
Disk quotas for user 44d83d32d97411e2a0e222000a8a2816 (uid 541): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     /dev/xvde2  717812       0 1048576             295       0   40000        


Move bug to verified.