Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-33533

Incorrect Load Balancing Algorithm Applied Due to Mismatched Ports in spec.port.to and Alternate Backend

XMLWordPrintable

    • Low
    • No
    • 1
    • NE Sprint 259
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      If a route is configured with spec.port.to pointing to a specific service port, but the alternate backend service(s) specify a different port, the load balancing strategy defaults to roundrobin instead of the expected random.
      
      Conversely, if you have a route and the spec.to service has a port that doesn't match spec.port.to, but the alternate backend has a valid port, it sets it to roundrobin instead of the expected random as well.
      
      The cause is that createServiceAliasConfig function currently does not filter out service units that do not have matching ports when calculating activeServiceUnits.
      
      This can potentially cause higher-than-normal HaProxy memory usage in these specific scenarios.

      Version-Release number of selected component (if applicable):

      4.12-4.16    

      How reproducible:

          100%

      Steps to Reproduce:

          1. Create route with a single alternate backend service that has a different port than spec.port.to service
          2. Observe HaProxy config file contains "roundrobin" for this backend instead of the expected "random"    

      Actual results:

          "roundrobin" algorithm for HaProxy backend

      Expected results:

           "random" algorithm for HaProxy backend

      Additional info:

          Miciah found the bug here: https://github.com/openshift/router/pull/576#issuecomment-2065129648

              rh-ee-alsyed Ali Syed
              gspence@redhat.com Grant Spence
              Melvin Joseph Melvin Joseph
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: