Bug 962380

Summary: Failed to removed mysql cartridge from diy app from node after V2 migration
Product: OKD Reporter: Jianwei Hou <jhou>
Component: ContainersAssignee: Paul Morie <pmorie>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers
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-11 03:56:46 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 Jianwei Hou 2013-05-13 10:15:11 UTC
Description of problem:
After v2 migration for mysql cartridge, when removing mysql from a diy application, the mysql is removed from mongodb, but its components(files, environment variables) remain on node.
This is reproduced with a diy app, not reproduced with php app. Maybe this is an issue against diy cartridge.

Version-Release number of selected component (if applicable):
Upgrading devenv-stage_351 to devenv_3219 and migrate

How reproducible:
Always

Steps to Reproduce:
1. Launch a devenv-stage_351 ami
2. Create apps with mysql-5.1(v1 format)
3. scp -r ~/devenv-local and /etc/yum.repos.d/local.repo from devenv_3219 instance to same location on devenv-stage_351 instance
4. yum -y update --enablerepo devenv-local (the instance will be default to v2 format after upgrade)
6. rhc-v2-migrate --version 2.0.28
7. Remove mysql cartridge from an app
8. SSH into app
  
Actual results:
After step 7: CLI reports success:
hjw@hjw ~$ rhc cartridge remove mysql-5.1 -a diy1 -px
Removing mysql-5.1 from 'diy1' ... removed
hjw@hjw ~$ rhc app show diy1
diy1 @ http://diy1-jhou.dev.rhcloud.com/ (uuid: 207408f6bbae11e2a26622000a8935e1)
---------------------------------------------------------------------------------
  Created: 5:18 PM
  Gears:   1 (defaults to small)
  Git URL: ssh://207408f6bbae11e2a26622000a8935e1.rhcloud.com/~/git/diy1.git/
  SSH:     207408f6bbae11e2a26622000a8935e1.rhcloud.com

  diy-0.1 (Do-It-Yourself)
  ------------------------
    Gears: 1 small

In mongo, the mysql cartridge is also removed.

After step 8: mysql is not removed from node
[diy1-jhou.dev.rhcloud.com 207408f6bbae11e2a26622000a8935e1]\> ls
app-root  diy  diy-0.1	git  mysql  mysql-5.1  phpmyadmin-3.4
[diy1-jhou.dev.rhcloud.com 207408f6bbae11e2a26622000a8935e1]\> env|grep MYSQL
OPENSHIFT_MYSQL_DIR=/var/lib/openshift/207408f6bbae11e2a26622000a8935e1/mysql/
OPENSHIFT_MYSQL_DB_PASSWORD=W_8ClW7xCkUb
OPENSHIFT_MYSQL_IDENT=redhat:mysql:5.1:0.2.0
OPENSHIFT_MYSQL_DB_USERNAME=adminB8Eu8p6
OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/207408f6bbae11e2a26622000a8935e1/mysql//socket/mysql.sock
OPENSHIFT_MYSQL_DB_URL=mysql://adminB8Eu8p6:W_8ClW7xCkUb.251.129:3306/
OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/207408f6bbae11e2a26622000a8935e1/mysql//log/

Expected results:
Mysql should be removed from both mongo and node.

Additional info:

Comment 1 Paul Morie 2013-05-14 23:35:45 UTC
I believe that this may have been a bug at one time, but I wasn't able to reproduce it in my devenv.  One thing to take note of is that the V2 migration creates links from the V1 directory names to the V2 directories in order to prevent breakages in apps that have hard-coded references to the V1 paths.  Check to make sure these links are present.

Comment 2 Jianwei Hou 2013-05-15 02:15:10 UTC
This wasn't reproducible when upgraded to devenv_3227. Mysql cartridge can be removed from an existing diy app successfully.
Mark as verified.