Bug 1285359 - nova-manage db archive_deleted_rows doesn't work
nova-manage db archive_deleted_rows doesn't work
Status: CLOSED WONTFIX
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova (Show other bugs)
6.0 (Juno)
x86_64 Linux
high Severity urgent
: ---
: 6.0 (Juno)
Assigned To: Radomir Dopieralski
nlevinki
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-25 08:07 EST by Eduard Barrera
Modified: 2017-10-20 10:08 EDT (History)
20 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-10-20 10:08:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1183523 None None None 2016-02-19 05:24 EST
Launchpad 1296690 None None None Never

  None (edit)
Description Eduard Barrera 2015-11-25 08:07:17 EST
Description of problem:

This command to purge the database for deleted instances doesn't work propperly

# nova-manage -v db archive_deleted_rows --max_rows  5000

# tail /var/log/nova/nova-manage.lof

2015-11-25 07:00:26.354 22803 ERROR oslo.db.sqlalchemy.exc_filters [req-24123197-ccae-40ec-aecf-3724a3766599 ] DBAPIError exception wrapped from (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`block_device_mapping`, CONSTRAINT `block_device_mapping_instance_uuid_fkey` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))') 'DELETE FROM instances WHERE instances.id in (SELECT T1.id FROM (SELECT instances.id \nFROM instances \nWHERE instances.deleted != %s ORDER BY instances.id \n LIMIT %s) as T1)' (0, 5000)
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters     context)
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters     cursor.execute(statement, parameters)
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters     self.errorhandler(self, exc, value)
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters     raise errorclass, errorvalue
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`block_device_mapping`, CONSTRAINT `block_device_mapping_instance_uuid_fkey` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))')
2015-11-25 07:00:26.354 22803 TRACE oslo.db.sqlalchemy.exc_filters 
2015-11-25 07:00:26.472 22803 WARNING nova.db.sqlalchemy.api [req-24123197-ccae-40ec-aecf-3724a3766599 None] IntegrityError detected when archiving table instances
2015-11-25 07:02:45.735 23181 DEBUG oslo.db.sqlalchemy.session [req-22e5ac3f-6458-4420-859c-1869a06b28a3 ] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/lib/python2.7/site-packages/oslo/db/sqlalchemy/session.py:482


It is already reported upstream:

https://bugs.launchpad.net/nova/+bug/1296690


Version-Release number of selected component (if applicable):
OSP 6

How reproducible:
always



Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Note You need to log in before you can comment on or make changes to this bug.