F5Networks / f5-openstack-lbaasv2-driver

F5 LBaaSv2 service provider driver for OpenStack Liberty and beyond
http://clouddocs.f5.com/products/openstack/lbaasv2-driver/master/
Apache License 2.0
21 stars 37 forks source link

Neutron ports cannot be created within a transaction as of newton #569

Closed pjbreaux closed 7 years ago

pjbreaux commented 7 years ago

Agent Version

pre-released newton

OpenStack Release

newton

Bug Severity

For bugs enter the bug severity level. Do not set any labels.

Severity: <Fill in level: 1 through 5>

Severity level definitions:

  1. Severity 1 (Critical) : Defect is causing systems to be offline and/or nonfunctional. immediate attention is required.
  2. Severity 2 (High) : Defect is causing major obstruction of system operations.
  3. Severity 3 (Medium) : Defect is causing intermittent errors in system operations.
  4. Severity 4 (Low) : Defect is causing infrequent interuptions in system operations.
  5. Severity 5 (Trival) : Defect is not causing any interuptions to system operations, but none-the-less is a bug.

Description

When neutron ports are manipulated (create, update, delete) in the driver, we use the _core_plugin attribute of the neutron-lbaas plugin to do those operations. An example can be found in neutron_client.py.

After some testing, we found that removing the transaction in the method linked above is not sufficient for all calls to create/update a port because the service_builder.py build operation does most of it's work as a transaction. And that build operation calls the neutron_client.py method linked above (making the neutron_client's transaction a subtransaction). The proposed solution is to defer port creation until after the service object has been mostly constructed, with the exception of member ports.

pjbreaux commented 7 years ago

There are other solutions for this problem, including using the neutron client to perform the CUD operation on the port, but that would mean a port is manipulated via REST while the REST call itself is happening in a transaction. And this might be bad.

pjbreaux commented 7 years ago

Also, neutron is now wrapping many of its CUD operations on objects with this decorator to prevent those object from being manipulated via transaction.

jgruber commented 7 years ago

Please confirm this is the source of these errors in the neutron server log on the controller.

2017-05-19 08:18:53.335 16019 ERROR f5lbaasdriver.v2.bigip.driver_v2 [req-a4bdbaca-0f43-47e8-9847-9b6f423784ca 23f8e30d98ce4e4eb760c9b7e477b45c d303c30a319d422097e5ab0be7b619cd - - -] Exception: create_member: This Session's transaction has been rolled back by a nested rollback() call. To begin a new transaction, issue Session.rollback() first.

Once this happens you must clean things up manually.

pjbreaux commented 7 years ago

@dflanigan: this issue has been addressed and is fixed in liberty up to master, but we likely did not reference this in our PRs.