Bug 1729746 - transactions: failing to create subnets can lead to left-overs
Summary: transactions: failing to create subnets can lead to left-overs
Status: NEW
Alias: None
Product: ovirt-provider-ovn
Classification: oVirt
Component: provider
Version: 1.2.22
Hardware: x86_64
OS: Linux
Target Milestone: ovirt-4.5.0
: ---
Assignee: Dominik Holler
QA Contact: Michael Burman
Depends On:
TreeView+ depends on / blocked
Reported: 2019-07-14 06:20 UTC by Miguel Duarte Barroso
Modified: 2021-01-05 06:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
oVirt Team: Network
mperina: ovirt-4.5?

Attachments (Terms of Use)

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):

How reproducible:

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).

Note You need to log in before you can comment on or make changes to this bug.