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
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
PR submitted to master.
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
Quota should be doubled for blocks and/or inodes if usage is above 50%. Available in devenv 3384.
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.