nova/nova/db
Matt Riedemann 0b92c7e741 Fix hard-delete of instance with soft-deleted referential constraints
When hard-deleting an instance we first delete related records
but the code was not taking into account soft-deleted related
records which will result in the instance delete failing due to
a referential constraint because soft-deleted records are not
really deleted when it comes to table constraints.

This fixes the issue by simply passing read_deleted='yes' to the
related record model query in the hard delete path.

The related unit test is updated to cover this scenario and a
typo in that same test is also fixed here.

Change-Id: I9fc5a9cc40ceffc450c1fde1df7fb36581e9cc94
Closes-Bug: #1830438
2019-05-29 17:27:00 -04:00
..
sqlalchemy Fix hard-delete of instance with soft-deleted referential constraints 2019-05-29 17:27:00 -04:00
__init__.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
api.py Merge "Stop handling 'update_cells' on 'BandwidthUsage.create'" 2019-05-29 03:56:20 +00:00
base.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
constants.py Move db MAX constants to own file 2018-03-01 11:09:29 +00:00
migration.py Manage db sync command for cell0 2016-08-22 18:53:45 +03:00