[Existing problem]
The oslo.db.sqlalchemy.session.EngineFacade is only a factory, and not a facade. This will make the code inconsistent, low performance, and potential bug. The details of its problems are described in [1].
Most intuitive issue is that oslo will report warning at [2]
[Proposal]
Use the new oslo_db.sqlalchemy.enginefacade to replace the current EngineFacade.
[Benefits]
A clean, less problem, higher performance db transaction.
[What is the enhancement?]
- Update neutron/db/api.py to use oslo method to create the singleton of LegacyEngineFacade.
- Update the current db transaction with new enginefacade. To avoid merge nightmare, this will be done in small pieces.
- Clean up the usage of LegacyEngineFacade
[Related information]
- [1] Oslo db spec: http://specs.openstack.org/openstack/oslo-specs/specs/kilo/make-enginefacade-a-facade.html
- [2] https://github.com/openstack/oslo.db/blob/60af1042b8123d67ed7c80d1a1720865a4255ad5/oslo_db/sqlalchemy/enginefacade.py#L956
- [3] Nova related spec: http://specs.openstack.org/openstack/nova-specs/specs/liberty/approved/oslo_db-enginefacade.html
I found another code[1] that uses EngineFacade. Will address it too.
[1] https:/ /github. com/openstack/ neutron/ blob/master/ neutron/ db/api. py#L44