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...
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
: Regression
Depends On:
  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:
Last Closed: 2012-11-06 13:49:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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]

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):

How reproducible:

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

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');

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:
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 

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