Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1062621 - 'rhc app show --state/--gear' shows db gear stop after restore snapshot for scalable app
Summary: 'rhc app show --state/--gear' shows db gear stop after restore snapshot for s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1030305
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-07 14:11 UTC by Brenton Leanhardt
Modified: 2017-03-08 17:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1030305
Environment:
Last Closed: 2014-05-15 14:40:48 UTC


Attachments (Terms of Use)

Description Brenton Leanhardt 2014-02-07 14:11:13 UTC
+++ This bug was initially created as a clone of Bug #1030305 +++

Description of problem:
Given one scalable app create(e.g., myjbossews20s), embed some db and do save snapshot, and then restore snapshot, found 'rhc app show --state/--gear' show the state of db gear stop not started, but 'rhc cartridge status' shows the status of db gear running. 


+ tmp=/var/lib/openshift/528495f36cec0eb09c00085c/jbossews//tmp
+ '[' -d /var/lib/openshift/528495f36cec0eb09c00085c/jbossews//tmp ']'
+ for d in '$tmp/*'
+ '[' -d '/var/lib/openshift/528495f36cec0eb09c00085c/jbossews//tmp/*' ']'
++ ls /var/lib/openshift/528495f36cec0eb09c00085c/app-root/runtime/repo//webapps
+ '[' '' ']'
Activation status: success
RESULT:
Success
[lijun@ray Work]$ rhc app show --gear -a myjbossews20s
ID                       State   Cartridges               Size  SSH URL
------------------------ ------- ------------------------ ----- ---------------------------------------------------------------------
528495f36cec0eb09c000860 stopped mysql-5.1                small 528495f36cec0eb09c000860@528495f36cec0eb09c000860-ray.int.rhcloud.com
528495f36cec0eb09c00086c stopped mongodb-2.2              small 528495f36cec0eb09c00086c@528495f36cec0eb09c00086c-ray.int.rhcloud.com
528495f36cec0eb09c00085c started jbossews-2.0 haproxy-1.4 small 528495f36cec0eb09c00085c@myjbossews20s-ray.int.rhcloud.com
[lijun@ray Work]$ rhc app show --state -a myjbossews20s
Cartridge mysql-5.1 is stopped
Cartridge mongodb-2.2 is stopped
Cartridge jbossews-2.0, haproxy-1.4 is started
[lijun@ray Work]$ rhc cartridge status  -a myjbossews20s -c mysql-5.1
RESULT:
MySQL is running
[lijun@ray Work]$ rhc cartridge status  -a myjbossews20s -c mongodb-2.2
RESULT:
MongoDB is running

Version-Release number of selected component (if applicable):
INT(devenv_4030)
devenv_4031

How reproducible:
always

Steps to Reproduce:
1.create one scalable app
#rhc app create myjbossews20s jbossews-2.0 -s mysql-5.1 mongodb-2.2
2.save snapshot
#rhc snapshot save myjbossews20s
3.restore snapshot and check the gear status 
#rhc snapshot restore -a myjbossews20s -f myjbossews20s.tar.gz
#rhc app show --gear -a myjbossews20s

Actual results:
'rhc app show --state/--gear' shows db gear stop

Expected results:
'rhc app show --state/--gear' should show db gear started

Additional info:

--- Additional comment from Vincent Batts on 2014-01-17 09:53:36 EST ---

so the web console also shows that they're stopped.

Though I see the pids running on the node itself.

1000     19688     1  0 Jan16 ?        00:00:00 /bin/bash /var/lib/openshift/658642806346601025503232/mysql/bin/control post-restore
1000     19693 19688  0 Jan16 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/var/lib/openshift/658642806346601025503232/mysql//conf/my.cnf
1000     19824 19693  0 Jan16 ?        00:00:22 /usr/libexec/mysqld --defaults-file=/var/lib/openshift/658642806346601025503232/mysql//conf/my.cnf --basedir=/usr --datadir=/var/lib/openshift/658642806346601025503232/mysql/data/ --log-error=/var/lib/openshift/658642806346601025503232/mysql//log/mysql_error.log --pid-file=/var/lib/openshift/658642806346601025503232/mysql/pid/mysql.pid --socket=/var/lib/openshift/658642806346601025503232/mysql//socket/mysql.sock
1001     19978     1  0 Jan16 ?        00:01:46 /usr/bin/mongod --auth -f /var/lib/openshift/3087259a7f0611e38d18fe428b6bd8e1/mongodb//conf/mongodb.conf run

--- Additional comment from Jhon Honce on 2014-01-20 18:02:11 EST ---

https://trello.com/c/SMPN5PNY

--- Additional comment from Jhon Honce on 2014-01-27 11:53:40 EST ---

Comment 1 Brenton Leanhardt 2014-02-07 14:12:23 UTC
We'll likely pick this up in the rebase but if the work is done sooner and the backport is trivial we should consider pulling this in.

Comment 4 Anping Li 2014-03-24 03:29:45 UTC
Verified with steps as below:
1. create app and add mysql gears:
[ose215@dhcp-9-237 ~]$ rhc app show myjbossews20s --gears
ID                       State   Cartridges               Size  SSH URL
------------------------ ------- ------------------------ ----- --------------------------------------------------------------------------------
532fa2a18fcf31fa2e000078 started haproxy-1.4 jbossews-2.0 small 532fa2a18fcf31fa2e000078@myjbossews20s-hanli1dom.ose-201403172.com.cn
532fa2e78fcf31fa2e000097 started mysql-5.5                small 532fa2e78fcf31fa2e000097@532fa2e78fcf31fa2e000097-hanli1dom.ose-201403172.com.cn

2. Snapshot saveing app
[ose215@dhcp-9-237 ~]$ rhc snapshot save myjbossews20s
Pulling down a snapshot to myjbossews20s.tar.gz...
Saving snapshot for secondary mysql-5.5 gear
Creating and sending tar.gz
Creating and sending tar.gz

RESULT:
Success

3.rhc app show myjbossews20s --gears
ID                       State   Cartridges               Size  SSH URL
------------------------ ------- ------------------------ ----- --------------------------------------------------------------------------------
532fa2a18fcf31fa2e000078 started haproxy-1.4 jbossews-2.0 small 532fa2a18fcf31fa2e000078@myjbossews20s-hanli1dom.ose-201403172.com.cn
532fa2e78fcf31fa2e000097 started mysql-5.5                small 532fa2e78fcf31fa2e000097@532fa2e78fcf31fa2e000097-hanli1dom.ose-201403172.com.cn

4.[ose215@dhcp-9-237 ~]$ rhc cartridge status mysql-5.5 -a myjbossews20s
RESULT:
MySQL is running

5.[ose215@dhcp-9-237 ~]$ rhc snapshot restore myjbossews20s -f myjbossews20s.tar.gz 
Restoring from snapshot myjbossews20s.tar.gz...
Removing old git repo: ~/git/myjbossews20s.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/myjbossews20s.git and ~/app-root/data
Restoring snapshot for mysql-5.5 gear
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
Old and new names are the same, no need to rename
+ tmp=/var/lib/openshift/532fa2a18fcf31fa2e000078/jbossews//tmp
+ '[' -d /var/lib/openshift/532fa2a18fcf31fa2e000078/jbossews//tmp ']'
+ for d in '$tmp/*'
+ '[' -d '/var/lib/openshift/532fa2a18fcf31fa2e000078/jbossews//tmp/*' ']'
+ '[' -d /var/lib/openshift/532fa2a18fcf31fa2e000078/jbossews//work/ ']'
+ rm -rf /var/lib/openshift/532fa2a18fcf31fa2e000078/jbossews//work/
++ ls /var/lib/openshift/532fa2a18fcf31fa2e000078/app-root/runtime/repo//webapps
+ '[' '' ']'
Activation status: success

RESULT:
Success

6.[ose215@dhcp-9-237 ~]$ rhc cartridge status mysql-5.5 -a myjbossews20sRESULT:
MySQL is running

7.[ose215@dhcp-9-237 ~]$ rhc app show myjbossews20s --gears
ID                       State   Cartridges               Size  SSH URL
------------------------ ------- ------------------------ ----- --------------------------------------------------------------------------------
532fa2a18fcf31fa2e000078 started haproxy-1.4 jbossews-2.0 small 532fa2a18fcf31fa2e000078@myjbossews20s-hanli1dom.ose-201403172.com.cn
532fa2e78fcf31fa2e000097 started mysql-5.5                small 532fa2e78fcf31fa2e000097@532fa2e78fcf31fa2e000097-hanli1dom.ose-201403172.com.cn

8. ssh gears and access mysql
mysql> use myjbossews20s
Database changed
mysql> create table t1(id int);
Query OK, 0 rows affected (0.08 sec)


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