L3 HA Least loaded scheduling policy doesn't work as it always schedules gateways in the same node
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
networking-ovn |
Fix Released
|
Undecided
|
Daniel Alvarez |
Bug Description
With the current implementation, L3 HA Least Loaded scheduling policy would always schedule gateways in the same node as it's only taking into account the number of ports scheduled in every chassis and not their priorities.
For example, imagine that we have gateways GW1 and GW2 and chassis C1, C2 and C3.
At the moment GW1 is added, this code [0] will return [C1, C2, C3] as all of them have zero ports scheduled on them. This means that C1 will host GW1 with prio3, C2 with prio2 and C3 with prio1.
When GW2 is now added, the same code will return [C1, C2, C3] again as all of them have 1 port scheduled on them (although with different priorities). This means that C1 will host GW1 and GW2 with prio3, C2 with prio2 and C3 with prio1.
This would be repeated for every new gateway added to the cloud meaning that C1 will host all *active* routers for North-South traffic (as highest priority means that it's going to be active for BFD [1]) creating a very unbalanced state. Furthermore, if C1 goes down, all gateways will be failed over to C2 keeping the same unbalanced load.
We need to implement the Least Loaded algorithm in such way that we take the current balance and priorities into account so that the load is as balanced as possible even in the event that some network nodes go down.
[0] http://
[1] https:/
Changed in networking-ovn: | |
assignee: | nobody → Daniel Alvarez (dalvarezs) |
Changed in networking-ovn: | |
status: | New → In Progress |
tags: | added: networking-ovn-proactive-backport-potential |
Reviewed: https:/ /review. openstack. org/559786 /git.openstack. org/cgit/ openstack/ networking- ovn/commit/ ?id=bbf0260496b f2e08db3c341b88 e124fa6d0c7156
Committed: https:/
Submitter: Zuul
Branch: master
commit bbf0260496bf2e0 8db3c341b88e124 fa6d0c7156
Author: Daniel Alvarez <email address hidden>
Date: Wed Apr 11 17:01:38 2018 +0200
L3HA: Take priorities into account in least loaded scheduling
This patch is implementing an algorithm to take the priorities of
the gateway ports into account when choosing a chassis using the
Least Loaded policy (default). Prior to this patch, the same chassis
would always be selected leading to an unbalanced distribution
of the gateway nodes.
Now, when a new gateway is being scheduled, it will take into
account the current priorities and will select the nodes and their
priorities accordingly so that the system remains balanced even
in the event that one of the nodes go down.
Also, I'm adding a new functional test which will check that the
ports have been scheduled as expected by looking directly into the
Southbound database.
Please, note that bug 1762691 could still make routers to not
be in HA mode and we need to address this issue separately.
Closes-Bug: 1762694 9b574b77dc6b5ab 5be262a12b7
Change-Id: I2df35cc31e856b
Signed-off-by: Daniel Alvarez <email address hidden>