Bug 1729746

Summary: transactions: failing to create subnets can lead to left-overs
Product: [oVirt] ovirt-provider-ovn Reporter: Miguel Duarte Barroso <mduarted>
Component: providerAssignee: Nobody <nobody>
Status: CLOSED DEFERRED QA Contact: Michael Burman <mburman>
Severity: low Docs Contact:
Priority: unspecified    
Version: 1.2.22CC: amusil, bugs, danken, dholler, mperina
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-20 08:09:04 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 Miguel Duarte Barroso 2019-07-14 06:20:08 UTC
Description of problem:
Creating a subnet requires multiple transactions:
  - 1 for updating the network object
  - 1 for creating the dhcp options object
  - 1 for updating the dhcp object options
  - 1 per each existent logical network port existent in the network

Since it is not done via a transaction (a mechanism that is now available on the provider code base), failing to create a subnet can leave leftovers behind (e.g. when it fails for one of the ports; the logical switch object is updated, the dhcp option object is created, the dhcp object is updated, and X ports are updated).

Using the transaction mechanism is a lot safer, since it assures either everything goes according to plan, or nothing does, enabling the system to be more scalable / deterministic.  

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

How reproducible:
always

Steps to Reproduce:
1. create a logical switch
2. create some 10 ports on that logical switch (the more the easier it is to reproduce)
3. create a subnet on top of the network object
4. interrupt the REST client before receiving a response from the provider

Actual results:
Some of the ports will not have been updated - missing IP addresses

Expected results:
Either all ports are updated (create subnet succeeded), or none are (create subnet failed).

Comment 1 Ales Musil 2021-10-20 08:09:04 UTC
The fix would be complicated and there is not enough resources to do it.