Merge "cinder-manage: Use same timestamp for purging deleted rows"

This commit is contained in:
Zuul
2025-06-03 14:07:17 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

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