Bug 963048 - oo-admin-ctl-gears doesn't start up embedded mysql carts
oo-admin-ctl-gears doesn't start up embedded mysql carts
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Rob Millner
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 23:44 EDT by Thomas Wiest
Modified: 2015-05-14 19:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 23:57:47 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 Thomas Wiest 2013-05-14 23:44:09 EDT
Description of problem:
oo-admin-ctl-gears isn't properly starting embedded mysql dbs. This is very bad because when we restart nodes, this script is run to start up the gears. So each node restart, and all gears on that node with an embedded mysql db are broken.


# oo-admin-ctl-gears stopgear fdebcf4b01544bafa52795957ba3ed95
Stopping fdebcf4b01544bafa52795957ba3ed95... [ OK ]
# ps -u fdebcf4b01544bafa52795957ba3ed95
  PID TTY          TIME CMD

# oo-admin-ctl-gears startgear fdebcf4b01544bafa52795957ba3ed95
Starting fdebcf4b01544bafa52795957ba3ed95... [ OK ]
# ps -u fdebcf4b01544bafa52795957ba3ed95
  PID TTY          TIME CMD
31219 ?        00:00:00 httpd
31221 ?        00:00:00 rotatelogs
31222 ?        00:00:00 rotatelogs
31223 ?        00:00:00 httpd
# 

Note that there isn't a mysql daemon running for the gear.

If I, however use oo-su and stop_app / start_app, mysql is properly started:

# oo-su fdebcf4b01544bafa52795957ba3ed95 -c "/bin/bash --init-file /usr/bin/rhcsh -c /usr/libexec/openshift/cartridges/abstract/info/bin/stop_app.sh"
Waiting for stop to finish
kill 29922: No such process
Done
# ps -u fdebcf4b01544bafa52795957ba3ed95
  PID TTY          TIME CMD
# oo-su fdebcf4b01544bafa52795957ba3ed95 -c "/bin/bash --init-file /usr/bin/rhcsh -c /usr/libexec/openshift/cartridges/abstract/info/bin/start_app.sh"
Done
# ps -u fdebcf4b01544bafa52795957ba3ed95  PID TTY          TIME CMD
32178 ?        00:00:00 mysqld_safe
32305 ?        00:00:00 mysqld
32383 ?        00:00:00 httpd
32385 ?        00:00:00 rotatelogs
32386 ?        00:00:00 rotatelogs
32388 ?        00:00:00 httpd
# 

Note the mysql process is running.


Version-Release number of selected component (if applicable):
openshift-origin-node-util-1.8.9-1.el6oso.noarch


How reproducible:
Very


Steps to Reproduce:
1. Create a gear with an embedded mysql db
2. Stop the gear
3. Start the gear using oo-admin-ctl-gears
4. Notice that mysql db isn't running


Actual results:
embedded mysql db isn't started


Expected results:
embedded mysql db should be started
Comment 1 Rob Millner 2013-05-15 16:04:34 EDT
The old oo-admin-ctl-gear script was setting/exporting APP_HOME and OPENSHIFT_HOME_DIR but the new version assumed that the start hook did that itself through setup_user_vars.

Fixed setup_user_vars so that the proper variables are set and exported.
Pull requests...
masater:  https://github.com/openshift/origin-server/pull/2487
stage:    https://github.com/openshift/origin-server/pull/2488

This should become a test-case.
Comment 2 openshift-github-bot 2013-05-15 17:47:58 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/574d1180f3163c02c2cf625b3c5f86e53b227bc8
Bug 963048 - the old oo-admin-ctl-gear script was setting/exporting APP_HOME and OPENSHIFT_HOME_DIR but the new version assumed that the start hook did that itself through setup_user_vars.
Comment 3 Rony Gong 2013-05-16 05:29:48 EDT
Verified on devenv-stage_353
Steps:
1.Create non-scalable application, then embed mysql cartridge
2.ssh into this instance by root, check the process of this app user
[root@ip-10-112-73-118 openshift]# ps -u  51943fa9075ab70a97000002
  PID TTY          TIME CMD
31729 ?        00:00:00 mysqld_safe
31851 ?        00:00:00 mysqld
31947 ?        00:00:00 httpd
31949 ?        00:00:00 rotatelogs
31951 ?        00:00:00 rotatelogs
31953 ?        00:00:00 httpd

3.stop this gear by oo-admin-ctl-gear
[root@ip-10-112-73-118 openshift]# oo-admin-ctl-gears stopgear 51943fa9075ab70a97000002
Stopping 51943fa9075ab70a97000002... [ OK ]

4.Check again this app user's process
[root@ip-10-112-73-118 openshift]# ps -u  51943fa9075ab70a97000002
  PID TTY          TIME CMD

5.start this gear by oo-admin-ctl-gear
[root@ip-10-112-73-118 openshift]# oo-admin-ctl-gears startgear 51943fa9075ab70a97000002
Starting 51943fa9075ab70a97000002... [ OK ]

6.Check again this app user's process
[root@ip-10-112-73-118 openshift]# ps -u  51943fa9075ab70a97000002
  PID TTY          TIME CMD
31729 ?        00:00:00 mysqld_safe
31851 ?        00:00:00 mysqld
31947 ?        00:00:00 httpd
31949 ?        00:00:00 rotatelogs
31951 ?        00:00:00 rotatelogs
31953 ?        00:00:00 httpd

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