Bug 998355 - oo-admin-ctl-app shoudn't be able to remove database gears from scalable apps
oo-admin-ctl-app shoudn't be able to remove database gears from scalable apps
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rajat Chopra
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-19 02:46 EDT by Liang Xia
Modified: 2015-05-14 20:20 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:52:33 EDT
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 Liang Xia 2013-08-19 02:46:01 EDT
Description of problem:
Create scalable app with database imbedded, try to remove database gears through oo-admin-ctl-app and it's removed successfully.

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

How reproducible:
always

Steps to Reproduce:
1.create scalable app with database imbedded.
  rhc app create appname jbossews-2.0 mysql-5.1 mongodb-2.2 postgresql-9.2 -s
2.check the gears in the app
  rhc app show appname --gears
3.try to remove the db gear via oo-admin-ctl-app
  oo-admin-ctl-app -l user -a appname -c remove-gear --gear_uuid <uuid_of_mysql>
  oo-admin-ctl-app -l user -a appname -c remove-gear --gear_uuid <uuid_of_mongodb>
  oo-admin-ctl-app -l user -a appname -c remove-gear --gear_uuid <uuid_of_postgresql>
4.check the gears in the app
  rhc app show appname --gears
5.check the app
  rhc app show appname
  
Actual results:
Step 3 finished successfully.
Step 5 still show the db info.

Expected results:
Step 3 should be failed to remove and get messages like below:
Gear <uuid> hosts singleton components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.

Additional info:
Comment 1 Rob Millner 2013-08-19 13:14:44 EDT
The tool and underlying logic are in the broker.
Comment 2 Abhishek Gupta 2013-08-19 15:39:56 EDT
Recent changes for HA resulted in this change.
Comment 3 Rajat Chopra 2013-08-20 11:44:31 EDT
Fixed with pull request https://github.com/openshift/origin-server/pull/3423
Comment 4 Liang Xia 2013-08-20 22:37:34 EDT
Reproduced on devenv_3680.
Database gears still can be removed. See steps and results below:

[root@ip-10-204-134-218 ~]# rhc app show appname --gears
ID                               State   Cartridges               Size  SSH URL
-------------------------------- ------- ------------------------ ----- --------------------------------------------------------------------------------------
f64494fc0a0811e3ba6612313b0a852c started mysql-5.1                small f64494fc0a0811e3ba6612313b0a852c@f64494fc0a0811e3ba6612313b0a852c-lxia.dev.rhcloud.com
768029664124824480382976         started mongodb-2.2              small 768029664124824480382976@768029664124824480382976-lxia.dev.rhcloud.com
5214251f246e420729000001         started postgresql-9.2           small 5214251f246e420729000001@5214251f246e420729000001-lxia.dev.rhcloud.com
f58521f80a0811e3ba6612313b0a852c started jbossews-2.0 haproxy-1.4 small f58521f80a0811e3ba6612313b0a852c@appname-lxia.dev.rhcloud.com

[root@ip-10-204-134-218 ~]# oo-admin-ctl-app -l lxia -a appname -c remove-gear --gear_uuid f64494fc0a0811e3ba6612313b0a852c
Success

[root@ip-10-204-134-218 ~]# oo-admin-ctl-app -l lxia -a appname -c remove-gear --gear_uuid 768029664124824480382976
Success

[root@ip-10-204-134-218 ~]# oo-admin-ctl-app -l lxia -a appname -c remove-gear --gear_uuid 5214251f246e420729000001
Success

[root@ip-10-204-134-218 ~]# oo-admin-ctl-app -l lxia -a appname -c remove-gear --gear_uuid f58521f80a0811e3ba6612313b0a852c
Gear f58521f80a0811e3ba6612313b0a852c hosts sparse components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.
Comment 5 Rajat Chopra 2013-08-21 09:14:55 EDT
Db cartridges may or may not be sparse carts by definition. Including checks for last gear of the group instance.
Fixed with https://github.com/openshift/origin-server/pull/3447
Comment 6 Liang Xia 2013-08-21 22:58:36 EDT
Verified on devenv_3683, it has been fixed.

Steps and results:
# rhc app show jbossews2s --gears
ID                               State   Cartridges               Size  SSH URL
-------------------------------- ------- ------------------------ ----- --------------------------------------------------------------------------------------
474936161729949510664192         started mysql-5.1                small 474936161729949510664192@474936161729949510664192-lxia.dev.rhcloud.com
ac3bafe60ad311e3b0d412313d08bd61 started postgresql-9.2           small ac3bafe60ad311e3b0d412313d08bd61@ac3bafe60ad311e3b0d412313d08bd61-lxia.dev.rhcloud.com
ac3e41700ad311e3b0d412313d08bd61 started mongodb-2.2              small ac3e41700ad311e3b0d412313d08bd61@ac3e41700ad311e3b0d412313d08bd61-lxia.dev.rhcloud.com
abca29a20ad311e3b0d412313d08bd61 started jbossews-2.0 haproxy-1.4 small abca29a20ad311e3b0d412313d08bd61@jbossews2s-lxia.dev.rhcloud.com
482640281228607802572800         started jbossews-2.0 haproxy-1.4 small 482640281228607802572800@482640281228607802572800-lxia.dev.rhcloud.com
e467776e0ad411e3b0d412313d08bd61 started jbossews-2.0 haproxy-1.4 small e467776e0ad411e3b0d412313d08bd61@e467776e0ad411e3b0d412313d08bd61-lxia.dev.rhcloud.com

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid 474936161729949510664192
Gear 474936161729949510664192 hosts sparse components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid ac3bafe60ad311e3b0d412313d08bd61
Gear ac3bafe60ad311e3b0d412313d08bd61 hosts sparse components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid ac3e41700ad311e3b0d412313d08bd61
Gear ac3e41700ad311e3b0d412313d08bd61 hosts sparse components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid abca29a20ad311e3b0d412313d08bd61
Gear abca29a20ad311e3b0d412313d08bd61 hosts sparse components within its group instance. You cannot remove it.
You can either remove the cartridge or delete the application.

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid 482640281228607802572800
Success

# oo-admin-ctl-app -l lxia@redhat.com -a jbossews2s -c remove-gear --gear_uuid e467776e0ad411e3b0d412313d08bd61
Success

# rhc app show jbossews2s --gears
ID                               State   Cartridges               Size  SSH URL
-------------------------------- ------- ------------------------ ----- --------------------------------------------------------------------------------------
474936161729949510664192         started mysql-5.1                small 474936161729949510664192@474936161729949510664192-lxia.dev.rhcloud.com
ac3bafe60ad311e3b0d412313d08bd61 started postgresql-9.2           small ac3bafe60ad311e3b0d412313d08bd61@ac3bafe60ad311e3b0d412313d08bd61-lxia.dev.rhcloud.com
ac3e41700ad311e3b0d412313d08bd61 started mongodb-2.2              small ac3e41700ad311e3b0d412313d08bd61@ac3e41700ad311e3b0d412313d08bd61-lxia.dev.rhcloud.com
abca29a20ad311e3b0d412313d08bd61 started jbossews-2.0 haproxy-1.4 small abca29a20ad311e3b0d412313d08bd61@jbossews2s-lxia.dev.rhcloud.com

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