Bug 1123371 - set-multiplier action should not be allowed on a non-HA scaling app.
Summary: set-multiplier action should not be allowed on a non-HA scaling app.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1123353
TreeView+ depends on / blocked
 
Reported: 2014-07-25 12:55 UTC by Luke Meyer
Modified: 2015-05-15 00:29 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1123353
Environment:
Last Closed: 2014-10-10 00:49:46 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Luke Meyer 2014-07-25 12:55:01 UTC
+++ This bug was initially created as a clone of Bug #1123353 +++

Description of problem:
Currently set-multiplier action is allowed to a non-HA scaling app, that would cause inconsistent behaviour. See the following for more details.

Version-Release number of selected component (if applicable):
puddle-2-1-2014-07-23

How reproducible:
Always

Steps to Reproduce:
1.Set up env, 1 broker + 2 nodes, and make sure ALLOW_MULTIPLE_HAPROXY_ON_NODE="false" in broker.conf
2.Create 2 scaling app.
$ rhc app create scaperlapp perl -s
$ rhc app create scaphp53app php-5.3 -s
3.To scaphp53app, do the following operation
# oo-admin-ctl-app -l jialiu -a scaphp53app -c set-multiplier --cartridge haproxy-1.4 --multiplier 1
4.To scaperlapp, do the following operation
$ rhc cartridge-scale perl-5.10 --min 2 -a scaperlapp
# oo-admin-ctl-app -l jialiu -a scaperlapp -c set-multiplier --cartridge haproxy-1.4 --multiplier 1
5.Check app info in server's mongodb.
6.Scale up for this two app.
$ rhc cartridge-scale perl-5.10 --min 4 -a scaperlapp
$ rhc cartridge-scale php-5.3 --min 4 -a scaphp53app

Actual results:
Step 5:
multiplier setting is not saved into mongo for scaperlapp, but saved for scaphp53app
ose:PRIMARY> db.applications.findOne({"name":"scaperlapp"},{group_overrides: 1})
{
	"_id" : ObjectId("53d235ccf13a79cd3c000098"),
	"group_overrides" : [
		{
			"components" : [
				{
					"comp" : "web_proxy",
					"cart" : "haproxy-1.4",
					"cart_id" : ObjectId("53a02edebe739b79db000004")
				},
				{
					"comp" : "perl-5.10",
					"cart" : "perl-5.10",
					"cart_id" : ObjectId("53a02edebe739b79db00000e")
				}
			],
			"min_gears" : 2
		}
	]
}

ose:PRIMARY> db.applications.findOne({"name":"scaphp53app"},{group_overrides: 1})
{
	"_id" : ObjectId("53d23597f13a79cd3c00007a"),
	"group_overrides" : [
		{
			"components" : [
				{
					"comp" : "web_proxy",
					"cart" : "haproxy-1.4",
					"cart_id" : ObjectId("53a02edebe739b79db000004"),
					"multiplier" : 1
				},
				{
					"comp" : "php-5.3",
					"cart" : "php-5.3",
					"cart_id" : ObjectId("53a02edebe739b79db000002")
				}
			]
		}
	]
}
Setp 6:
scaperlapp is scaled up successfully, but failed for scaphp53app.
$ rhc cartridge-scale perl-5.10 --min 4 -a scaperlapp
This operation will run until the application is at the minimum scale and may take several minutes.
Setting scale range for perl-5.10 ... done

perl-5.10 (Perl 5.10)
---------------------
  Scaling: x4 (minimum: 4, maximum: available) on small gears

$ rhc cartridge-scale php-5.3 --min 4 -a scaphp53app
This operation will run until the application is at the minimum scale and may take several minutes.
Setting scale range for php-5.3 ... 
Unable to complete the requested operation due to: No nodes available. Please try again and contact support if the issue persists. 
Reference ID: b1e3cf972ab39524c7210fb866bc649c

Seem like broker is treating this app as HA scaling app, and take multiplier setting into consideration to select available node, and the error message is confused to user, will open another bug to tracking helpless error message issue.

Expected results:
If this ap is not a HA scaling app, set-multiplier action should be allowed, that would make everything happy, so such inconsistence.

Additional info:

--- Additional comment from Luke Meyer on 2014-07-25 08:53:38 EDT ---

The multiplier doesn't really make sense if the app isn't HA. I'm curious what happens to non-HA apps when the default multiplier is set at the broker... probably nothing. So I'm wondering why setting the multiplier explicitly does anything.

Just to point it out above - the difference between the apps is that one was scaled to 2 gears before applying the multiplier. That one had no problems and didn't seem to even record the multiplier. I'm not sure why the one-gear app recorded the multiplier, and I think the "no nodes available" message is probably misleading.

Comment 1 Abhishek Gupta 2014-07-28 19:57:24 UTC
Firstly, there is value in setting a multiplier without an application being HA. Multiplier is a generic concept for any sparse cart, whereas HA only deals with (at least today) with the HAProxy cartridge. A user may want to regulate the instances of a sparse cart regardless of whether an application is HA or not.

Secondly, there was a bug in the code that was blocking the multiplier value from being recorded if the cartridge min/max scaling values were already set. This bug would allow disallow the multiplier from being changed, once set. This will be fixed.

Thirdly, the 'DEFAULT_HA_MULTIPLIER' configuration, by virtue of its name, specifically deals with the HA multiplier in case of HA applications and applies only to the haproxy cartridge. Hence, I would not consider that to be an issue if it does not take effect for non-HA applications.

Comment 2 Abhishek Gupta 2014-07-28 23:28:56 UTC
The issue with setting/modifying the multiplier is fixed with this PR --> https://github.com/openshift/origin-server/pull/5668

Comment 3 openshift-github-bot 2014-07-29 01:10:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/42d048dbb774b35c1895395851f0f145297fb88f
Bug 1123371: Fixing issue with setting the cartridge multiplier

Comment 4 Jianwei Hou 2014-07-29 07:50:47 UTC
I'm able to reproduce this issue on devenv_5020

Verified on devenv_5021
1. Create 2 scalable applications
2. Set min scale to one of the apps
3. Set multiplier to both apps
4. Query mongo and verify the multiplier and min of group_overrides are updated correctly:
ip-10-179-168-102(mongod-2.4.6)[PRIMARY] openshift_broker_dev> db.applications.findOne({'name':'php1s'},{'group_overrides':1})
{
  "_id": ObjectId("53d77f56be68ab0eed000001"),
  "group_overrides": [
    {
      "components": [
        {
          "cart": "haproxy-1.4",
          "cart_id": ObjectId("53d74b2634f81bd57a000022"),
          "comp": "web_proxy",
          "multiplier": 1
        },
        {
          "cart": "php-5.3",
          "cart_id": ObjectId("53d74b2634f81bd57a000024"),
          "comp": "php-5.3"
        }
      ]
    }
  ]
}
ip-10-179-168-102(mongod-2.4.6)[PRIMARY] openshift_broker_dev> db.applications.findOne({'name':'php2s'},{'group_overrides':1})
{
  "_id": ObjectId("53d78025be68ab0eed000020"),
  "group_overrides": [
    {
      "components": [
        {
          "cart": "haproxy-1.4",
          "cart_id": ObjectId("53d74b2634f81bd57a000022"),
          "comp": "web_proxy",
          "multiplier": 1
        },
        {
          "cart": "php-5.3",
          "cart_id": ObjectId("53d74b2634f81bd57a000024"),
          "comp": "php-5.3"
        }
      ],
      "min_gears": 2
    }
  ]
}
5. Applications can be scaled up successfully.


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