Bug 860536 - gears info will not record into gear-registry.db and failed to redirect connection to gears when access the scalable app dns
gears info will not record into gear-registry.db and failed to redirect conne...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-26 01:20 EDT by Meng Bo
Modified: 2015-05-14 18:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:49:06 EST
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)
gears_on_haproxy_status_page (75.67 KB, image/png)
2012-09-26 01:20 EDT, Meng Bo
no flags Details

  None (edit)
Description Meng Bo 2012-09-26 01:20:29 EDT
Created attachment 617391 [details]
gears_on_haproxy_status_page

Description of problem:

Create scalable app, and disable the auto scaling for it. Scale-up the app. Go to the /haproxy-status/ page, only the gears gear-<appname>-<domainname> and local-gear exist. SSH to the app and try to check the haproxy-1.4/conf/gear-registry.db, nothing in it.
Access the APP DNS, it will not redirect to the other gears.

Version-Release number of selected component (if applicable):
devenv_2229
cartridge-haproxy-1.4-0.16.2-1.el6_3.noarch

How reproducible:
always

Steps to Reproduce:
1.Create scalable app and disable the auto scaling
$rhc app create -a php1s -s -t php-5.3
2.Scale up the app
3.Go to haproxy/status/ page to check the gears
4.SSH to the app and check the gear-registry.db content
5.Write the following code to the php/index.php to grep the Gear DNS
<?php
    echo "GEAR DNS: " . $_ENV['OPENSHIFT_GEAR_DNS']
?>


Actual results:
3. Only gear-php1s-bmengdev and local-gear exist
4. Nothing in the gear-registry.db
5. It will always show the APP DNS when access the url via different session. 

Expected results:
3. All gears should show here.
4. All gears should exist in the gear-registry.db
5. It should redirect the connection to different gears each access.

Additional info:
User can get the gear info via REST API /gear_groups/
Comment 1 Ram Ranganathan 2012-09-27 17:50:18 EDT
As per a conv. w/ Mrunal, picking this one up.
Comment 2 Ram Ranganathan 2012-09-27 18:51:06 EDT
Works fine for me -- couple of things:
1. devenv_2229 looks to be really old -- am on devenv_2246.
2. The second part is in step 5 -- don't use $_ENV  -- that might not always work 
   -- try getenv instead. Try something like: 
    echo "GEAR DNS: " . getenv('OPENSHIFT_GEAR_DNS');
   instead.

If it still fails for you, please attach the haproxy.cfg, gear-registry.db and broker + mcollective logs -- those would contain clues re: why the connectors did not publish/put all the gears 
into the registry.
Comment 3 Ram Ranganathan 2012-09-27 20:12:29 EDT
Figured out why this is broken -- its because of a fix made to bugz 857205. 

The issue is set-gear-endpoints haproxy connector is called for both the
proxy/framework and  web/framework -- and depending on the order things are 
processed, we will end up w/ randomness of this working or not. 

Need to "fix" the fixes made in bugz 857205  in order for this to work properly.
Comment 4 Ram Ranganathan 2012-09-27 20:19:56 EDT
Waiting on pull request to be merged:
   https://github.com/openshift/crankcase/pull/543
Comment 5 Meng Bo 2012-09-28 07:15:56 EDT
Checked on devenv_2250, issue has been fixed.


[php1s-bmengdev.dev.rhcloud.com conf]\> cat gear-registry.db 
f1d2dbfb093b45629ab683e0b1d0ef57@10.10.98.245:f1d2dbfb09;f1d2dbfb09-bmengdev.dev.rhcloud.com
b3e47b7195f8401c9e4d94351e6241dd@10.10.98.245:b3e47b7195;b3e47b7195-bmengdev.dev.rhcloud.com

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