Alona Kaplan has submitted this change and it was merged.
Change subject: core: Do not acquire in left-most-available order
......................................................................
core: Do not acquire in left-most-available order
Before this path, when querying MAC from pool, always the leftmost
MAC, from first range with available MAC, was returned. This approach
caused problems when removing/creating new VMs within short time
period.
To remove this problems, before MAC is returned from pool again, all
other free MAC in pool has to be used. As a coincidence of this
change also ranges 'takes turns'. So if we have 3 ranges and perform 3
'queries', each of them will be performed on different range, where
query in this context mean 'acquisition of 1..N MACs'.
Example:
Assume that there are two Ranges, defined as <1,2>, <3,4,5>. Client
code contains single thread, which query pool for MAC, and return it
back before querying for another one. No MAC was queried so far. In
this case, MAC will be returned in this order:
1, 3, 2, 4, 1, 5, 2, 3, 1, 4, 2, 5
then the sequence repeats from start.
Change-Id: I00f4ebf8371c1a0e531baf7ef764c99d0be63ab2
Bug-Url:
https://bugzilla.redhat.com/1269301
Signed-off-by: Martin Mucha <mmucha(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/macpoolmanager/MacsStorage.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/macpoolmanager/Range.java
A
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/macpoolmanager/MacsStorageTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/macpoolmanager/RangeTest.java
4 files changed, 140 insertions(+), 9 deletions(-)
Approvals:
Martin Mucha: Verified
Alona Kaplan: Looks good to me, approved; Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/49502
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I00f4ebf8371c1a0e531baf7ef764c99d0be63ab2
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkaplan(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki <mmirecki(a)redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>