Bug 1122657

Summary: Scale-down picks up incorrect gear in HA apps
Product: OpenShift Online Reporter: Rajat Chopra <rchopra>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: jhou, jokerman, mmccomas, qixuan.wang, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1122935 (view as bug list) Environment:
Last Closed: 2014-10-10 00:49:31 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:
Bug Depends On:    
Bug Blocks: 1122935    

Description Rajat Chopra 2014-07-23 17:24:41 UTC
Description of problem:
Scaling down an app which is HA picks up the wrong gear if HA was enabled when app had more than two gears.

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


How reproducible:
Always

Steps to Reproduce:
1. Create a scalable app and scale up to 3 gears
2. Make the app HA by issuing the REST API. Scale-up once more to have the 4th gear have haproxy in it.
3. Scale-down.

Actual results:
The gear brought down by scale-down event contained haproxy in it, thus rendering the app non-ha.

Expected results:
The gear selection for scale-down should account for HA/sparse-cart-multiplier/sparse-cart-min, so that an HA app is never reduced to being non-HA.

Additional info:

Comment 1 openshift-github-bot 2014-07-25 18:50:33 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/023dfc859ca71b6579b71a670c016a6220ac4175
Bug 1122657: Fixing logic to select gear for scaledown

Comment 2 Abhishek Gupta 2014-07-25 19:10:45 UTC
Fixed with --> https://github.com/openshift/origin-server/pull/5653

Comment 3 Jianwei Hou 2014-07-28 03:13:54 UTC
Verified on devenv_5011

1. Create a scalable app and scale up to 3 gears
2. Make the app HA by issuing the REST API. Scale-up once more to have the 4th gear have haproxy in it.
3. Scale-down.

After step 2: There are 4 gears in the app, two of them has haproxy
[root@ip-10-61-174-12 openshift]# tree  -L 2
.
|-- 314349817564537529827328
|   |-- app-deployments
|   |-- app-root
|   |-- git
|   `-- php
|-- 314349817564537529827328-jhou -> 314349817564537529827328
|-- 372976169470936775393280
|   |-- app-deployments
|   |-- app-root
|   |-- gear-registry
|   |-- git
|   |-- haproxy
|   `-- php
|-- 372976169470936775393280-jhou -> 372976169470936775393280
|-- 40b2ffe6162511e49d9576524b0cfa95
|   |-- app-deployments
|   |-- app-root
|   |-- git
|   `-- php
|-- 40b2ffe6162511e49d9576524b0cfa95-jhou -> 40b2ffe6162511e49d9576524b0cfa95
|-- 53d5f58dbe8b57ae56000060
|   |-- app-deployments
|   |-- app-root
|   |-- gear-registry
|   |-- git
|   |-- haproxy
|   `-- php
|-- last_access.log
`-- php1s-jhou -> 53d5f58dbe8b57ae56000060

After step 3: The app scaled down, one gear without haproxy is removed
[root@ip-10-61-174-12 openshift]# tree  -L 2
.
|-- 372976169470936775393280
|   |-- app-deployments
|   |-- app-root
|   |-- gear-registry
|   |-- git
|   |-- haproxy
|   `-- php
|-- 372976169470936775393280-jhou -> 372976169470936775393280
|-- 40b2ffe6162511e49d9576524b0cfa95
|   |-- app-deployments
|   |-- app-root
|   |-- git
|   `-- php
|-- 40b2ffe6162511e49d9576524b0cfa95-jhou -> 40b2ffe6162511e49d9576524b0cfa95
|-- 53d5f58dbe8b57ae56000060
|   |-- app-deployments
|   |-- app-root
|   |-- gear-registry
|   |-- git
|   |-- haproxy
|   `-- php
|-- last_access.log
`-- php1s-jhou -> 53d5f58dbe8b57ae56000060