Bug 1283062

Summary: Updates and/or calls to MAC address Pool are not bound to DB transaction.
Product: [oVirt] ovirt-engine Reporter: Martin Mucha <mmucha>
Component: Backend.CoreAssignee: Martin Mucha <mmucha>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: bugs, danken, masayag, mavital, ylavi
Target Milestone: ovirt-4.0.0-rcKeywords: CodeChange
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
danken: devel_ack+
mavital: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-15 08:41:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Mucha 2015-11-18 07:17:30 UTC
Description of problem:

Updates to pool are not bound to transaction in any way. Any failure will block further processing and revert db. The only thing, which does not revert, and we do not even know how to do it(!), is macPool alteration. That means change pool settings, acquiring and returning macs. If that happens, some MACs may become erroneously marked as used or unused.

When updating pool ranges settings we currently use this strategy: do pool modification as a last action and 'hope' that this operation itself will not fail. If it will fail there, for any reason (incl. java.lang.Error)., in memory pool become corrupted, however it's quite unlikely that this will happen.


To fix this issue for acquiring/releasing macs we have to examine all usages and fix them some how, or better, we have to bound these actions on mac pool to current transaction and revert them, if that transaction is reverted. 

1) when updating pool, we must support 'undo'. That can be achieved via a) creating new instances and once they're ready swap them for original one. b) creating chain of instances representing performed actions — journal — and replay it back. Both will require new methods on pool.
2) all code acquiring / releasing mac from/to pool needs 'onrollback listener handler'. One possible solution would be, that pool itself remembers to/from whom he given/got certain mac and in which transaction. Using transaction completion listener he'd clear that list or reverted performed action. This will have to also grant, that released mac isn't actually available until COMMIT, and acquired mac won't be available until rollback even if transaction requiring it wasn't committed yet.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Dan Kenigsberg 2015-12-21 15:10:41 UTC
The solution seems complex, and the bug has existed since we have mac pools. I see no reason to backport it without clear customer case.

Comment 2 Mike McCune 2016-03-28 23:09:17 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 3 Sandro Bonazzola 2016-05-02 10:10:10 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 4 Yaniv Lavi 2016-05-23 13:26:03 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 5 Yaniv Lavi 2016-05-23 13:26:31 UTC
oVirt 4.0 beta has been released, moving to RC milestone.