Bug 1456989

Summary: [3.2][RFE] Randomize node lists
Product: OpenShift Container Platform Reporter: Eric Paris <eparis>
Component: NetworkingAssignee: Samuel Munilla <smunilla>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, bbennett, bleanhar, bmeng, bvincell, byount, eparis, rchopra, zzhao
Version: 3.2.0   
Target Milestone: ---   
Target Release: 3.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: Setting the router environment variable ROUTER_BACKEND_PROCESS_ENDPOINTS=shuffle will randomize the order of backends in the haproxy configuration. Reason: With long running sessions and a router which reloads regularly the first endpoint in the config may receive significantly more load than other backends. Setting the environment variable will randomize the order of the backends on every reload and thus help spread the load.
Story Points: ---
Clone Of: 1447115 Environment:
Last Closed: 2017-06-15 18:41:12 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: 1447115    
Bug Blocks: 1455325, 1455326, 1455327    

Comment 1 Eric Paris 2017-05-30 21:29:38 UTC
https://github.com/openshift/ose/pull/735

Comment 3 zhaozhanqi 2017-06-01 07:49:12 UTC
Check this on v3.2.1.33 and haproxy images id(61699ea1f924)

Check the haproxy-config.template in the haproxy image was not merged the env ROUTER_BACKEND_PROCESS_ENDPOINTS. 

please help rebuild the image. thanks.

Comment 4 Brenton Leanhardt 2017-06-05 13:28:25 UTC
Sam, this fix makes changes to the router haproxy-config.template which lives in dist-git.  You will have to apply the change from each PR to the respective branch in the openshift-enterprise-haproxy-router-docker dist-git repo.  You can take a look at the remotes/origin/private-scratch-3.2 branch in that repo to see how I did it for a 3.2 scratch build.  Let me know if you have questions.

Comment 5 Samuel Munilla 2017-06-05 19:34:51 UTC
Images rebuilt with dist-git config changes.

Comment 6 zhaozhanqi 2017-06-06 02:28:01 UTC
verified this bug on openshift v3.2.1.34 with haproxy image:7841535d6e7b

steps:
 
   1. oc env dc/router-intranet ROUTER_BACKEND_PROCESS_ENDPOINTS=shuffle
   2. Create backend pod with replias=5
   3. Check the haproxy.config
  
      server d22048973ff6bfa86a7a29ee5d0adb75 10.1.0.8:8080 check inter 5000ms cookie d22048973ff6bfa86a7a29ee5d0adb75
                
  server 1edca0d98a7ee1e89a4a8b995793dabc 10.1.0.9:8080 check inter 5000ms cookie 1edca0d98a7ee1e89a4a8b995793dabc
                
  server f4e59a0fa86288143cf82cdb5e33bf03 10.1.0.6:8080 check inter 5000ms cookie f4e59a0fa86288143cf82cdb5e33bf03
                
  server f8491224f3859c6797f40f737235f9ec 10.1.0.3:8080 check inter 5000ms cookie f8491224f3859c6797f40f737235f9ec
                
  server 52c859482bde20a799bff459f23a9ef0 10.1.0.7:8080 check inter 5000ms cookie 52c859482bde20a799bff459f23a9ef0

Comment 8 errata-xmlrpc 2017-06-15 18:41:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1425