Merge "cinder-manage: Use same timestamp for purging deleted rows"
This commit is contained in:
@@ -8100,6 +8100,7 @@ def purge_deleted_rows(context, age_in_days):
|
||||
metadata = MetaData()
|
||||
metadata.reflect(engine)
|
||||
|
||||
deleted_age = timeutils.utcnow() - dt.timedelta(days=age_in_days)
|
||||
for table in reversed(metadata.sorted_tables):
|
||||
if 'deleted' not in table.columns.keys():
|
||||
continue
|
||||
@@ -8110,7 +8111,6 @@ def purge_deleted_rows(context, age_in_days):
|
||||
{'age': age_in_days, 'table': table},
|
||||
)
|
||||
|
||||
deleted_age = timeutils.utcnow() - dt.timedelta(days=age_in_days)
|
||||
try:
|
||||
# Delete child records first from quality_of_service_specs
|
||||
# table to avoid FK constraints
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
`Bug #2111461 <https://bugs.launchpad.net/cinder/+bug/2111461>`_: Fixed
|
||||
issue preventing cinder-manage command to purge deleted rows due to
|
||||
foreign key constraint errors. This happened as timestamp for bulk
|
||||
delete operations were recalculated per table resulting in slighty
|
||||
different intervals for deleting rows on primary and dependents
|
||||
tables.
|
||||
Reference in New Issue
Block a user