Bug 965008

Summary: gear created by scale-up will be changed from idle to started after moving to another node
Product: OpenShift Online Reporter: zhaozhanqi <zzhao>
Component: PodAssignee: Mrunal Patel <mpatel>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rpenta, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 04:06:28 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 zhaozhanqi 2013-05-20 09:46:03 UTC
Description of problem:
create an scalalbe app and then scale-up this app,idle the gear created by scale-up, moving the gear to another node,  check the gear's status after moving,it will be change to started.

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

How reproducible:
always

Steps to Reproduce:
1. set multi-node env (node a and node b)
2. create an scalable app
3. scale-up this app
4. change all of gears to idle status 
5. moving the gear to another node
6. check the gear's status after moving

Actual results:

after step 4:
[zqzhao@dhcp-13-222 non_scalable]$ rhc app show zqpy26s -g
ID                               State Cartridges             Size  SSH URL
-------------------------------- ----- ---------------------- ----- -------------------------------------------------------------------------------------
0c75624ac12711e28ae512313d2d5271 idle  python-2.6 haproxy-1.4 small 0c75624ac12711e28ae512313d2d5271.rhcloud.com
5f67b7bec12711e28ae512313d2d5271 idle   python-2.6 haproxy-1.4 small 5f67b7bec12711e28ae512313d2d5271.rhcloud.com


after step 6.

[zqzhao@dhcp-13-222 non_scalable]$ rhc app show zqpy26s -g
ID                               State   Cartridges             Size  SSH URL
-------------------------------- ------- ---------------------- ----- -------------------------------------------------------------------------------------
0c75624ac12711e28ae512313d2d5271 idle python-2.6 haproxy-1.4 small 0c75624ac12711e28ae512313d2d5271.rhcloud.com
5f67b7bec12711e28ae512313d2d5271 started python-2.6 haproxy-1.4 small 5f67b7bec12711e28ae512313d2d5271.rhcloud.com

Expected results:
after step 6, the 5f67b7bec12711e28ae512313d2d5271 should be idle status

Additional info:

Comment 1 Ravi Sankar 2013-05-21 02:18:42 UTC
We have 2 problems during gear move:
- 'idle' gear state will change to 'started'.
- oo-idler will say gear 'idle' for the head/ha-proxy gear although ha-proxy process is still running on the gear.

Problem:
cond-reload functionality is missing in V2 HA-proxy cart.
When app connections are executed, V1 ha-proxy is doing cond-reload but in V2 ha-proxy is doing restart. Only when the app state is 'started', we should do either reload/restart of the ha-proxy service.
Look at restart() vs reload() vs cond_reload() methods in /usr/libexec/openshift/cartridges/haproxy-1.4/info/bin/app_ctl.sh

Comment 3 zhaozhanqi 2013-05-22 07:10:41 UTC
Test this issue on devenv_3258, it has been fixed

 [zqzhao@dhcp-13-222 .ssh]$ rhc app show zqpy26s -g
ID                               State Cartridges             Size  SSH URL
-------------------------------- ----- ---------------------- ----- ---------------------------------------------------------------------
ff0d6184c2ac11e2927312313d04dd3f idle python-2.6 haproxy-1.4 small ff0d6184c2ac11e2927312313d04dd3f.rhcloud.com
519c6d1bfbf25c0c66000003         idle python-2.6 haproxy-1.4 small 519c6d1bfbf25c0c66000003.rhcloud.com


after moving:
[root@ip-10-114-234-205 ~]# oo-admin-move --gear_uuid 519c6d1bfbf25c0c66000003 -i ip-10-114-234-205
URL: http://zqpy26s-zqd.dev.rhcloud.com
Login: zzhao+1
App UUID: 519c6c90fbf25cffe900001b
Gear UUID: 519c6d1bfbf25cffe900003c
DEBUG: Source district uuid: NONE
DEBUG: Destination district uuid: NONE
DEBUG: Getting existing app 'zqpy26s' status before moving
DEBUG: Gear component 'python-2.6' was stopped
DEBUG: Creating new account for gear '519c6d1bfbf25c0c66000003' on ip-10-114-234-205
DEBUG: Moving content for app 'zqpy26s', gear '519c6d1bfbf25c0c66000003' to ip-10-114-234-205
Identity added: /var/www/openshift/broker/config/keys/rsync_id_rsa (/var/www/openshift/broker/config/keys/rsync_id_rsa)
Warning: Permanently added '10.196.90.40' (RSA) to the list of known hosts.
Warning: Permanently added '10.114.234.205' (RSA) to the list of known hosts.
Agent pid 11962
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 11962 killed;
DEBUG: Moving system components for app 'zqpy26s', gear '519c6d1bfbf25c0c66000003' to ip-10-114-234-205
Identity added: /var/www/openshift/broker/config/keys/rsync_id_rsa (/var/www/openshift/broker/config/keys/rsync_id_rsa)
Agent pid 12024
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 12024 killed;
DEBUG: Fixing DNS and mongo for gear '519c6d1bfbf25c0c66000003' after move
DEBUG: Changing server identity of '519c6d1bfbf25c0c66000003' from 'ip-10-196-90-40' to 'ip-10-114-234-205'
DEBUG: Deconfiguring old app 'zqpy26s' on ip-10-196-90-40 after move
Successfully moved gear with uuid '519c6d1bfbf25c0c66000003' of app 'zqpy26s' from 'ip-10-196-90-40' to 'ip-10-114-234-205'



[zqzhao@dhcp-13-222 .ssh]$ rhc app show zqpy26s -g
ID                               State Cartridges             Size  SSH URL
-------------------------------- ----- ---------------------- ----- ---------------------------------------------------------------------
ff0d6184c2ac11e2927312313d04dd3f idle python-2.6 haproxy-1.4 small ff0d6184c2ac11e2927312313d04dd3f.rhcloud.com
519c6d1bfbf25c0c66000003         idle python-2.6 haproxy-1.4 small 519c6d1bfbf25c0c66000003.rhcloud.com