Bug 895026

Summary: [fork][model refactor] The consumed gears will be increased incorrectly according to minimum gears set by user even if the app is not scaled-up
Product: OKD Reporter: joycezhang <jinzhang>
Component: PodAssignee: Rajat Chopra <rchopra>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers, rchopra
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 23:46:19 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:
Attachments:
Description Flags
scale event none

Description joycezhang 2013-01-14 10:23:28 UTC
Description of problem:
If try to set minimum gears with the number larger than 1 for a scalable app, the consumed gears would be increased according to the changes of minimum gears which is not the actual consumed gears.

Version-Release number of selected component (if applicable):
fork_ami_refctr1_404
rhc-1.3.3-1.el6_3.noarch

How reproducible:
always

Steps to Reproduce:
1.Create a scalable app
2.Check the consumed gears by rest api
curl -k -H 'Accept: application/xml' --user jinzhang+3:redhat https://ec2-184-72-175-110.compute-1.amazonaws.com/broker/rest/user
3.Set the minmum gears for this scalable with large number
#rhc cartridge scale ruby-1.9 -a ruby19s --min 3 -l jinzhang+3
4. Repeat step2 to check the consumed gears again.
  
Actual results:
To step2: The consumed gears are 1 by default.
To step4: The consumed gears are changed to 3 according to the changed minimum gears.

Expected results:
To step4: The consumed gears should still be 1 as the app is not scaled-up.

Additional info:

Comment 1 Rajat Chopra 2013-01-15 00:22:48 UTC
Could you check and confirm if the app did not scale-up? The model-refactor code is different in the way that it would cause auto-scaleup to take effect.

Comment 2 joycezhang 2013-01-15 08:25:45 UTC
Here's the details for your reference:

1.Create a scalable app
2.Set the minmum gears for this scalable with large number
#rhc cartridge scale nodejs-0.6 -a myapp1 --min 3 
3.Check app gears:

  app infor via rhc client:

  myapp1 @ http://myapp1-test1.dev.rhcloud.com/ (uuid: 50f4eaf1fa2de2710800006c)
  ==============================================================================
    Created: 5:36 AM
    Git URL: ssh://50f4eaf1fa2de2710800006c.rhcloud.com/~/git/myapp1.git/
    SSH:     50f4eaf1fa2de2710800006c.rhcloud.com

    nodejs-0.6 (Node.js 0.6)
    ========================
      Scaling: x3 (minimum: 3, maximum: available) on small gears

    haproxy-1.4 (HAProxy 1.4)
    =========================
  
   gears infor via rest api:

<gear-group>
      <uuid>50f4eaf1fa2de2710800007f</uuid>
      <name>50f4eaf1fa2de2710800007f</name>
      <gear-profile>small</gear-profile>
      <gears>
        <gear>
          <id>50f4eaf1fa2de2710800006c</id>
          <state>started</state>
        </gear>
        <gear>
          <id>50f5075bfa2de27108000093</id>
          <state>started</state>
        </gear>
        <gear>
          <id>50f5075bfa2de27108000094</id>
          <state>started</state>
        </gear>
      </gears>

Comment 3 joycezhang 2013-01-15 08:26:53 UTC
Created attachment 678670 [details]
scale event

Comment 4 Rajat Chopra 2013-01-15 19:13:39 UTC
So the app has scaled to 3 gears, and consumed gears is showing '3', right?
What is wrong?

Comment 5 joycezhang 2013-01-17 07:03:42 UTC
So it should work as design. Move to Verified for closing is as NOT A BUG. Thanks.