← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1562863] Re: The command "nova-manage db archive_deleted_rows" doesn't move the entries to the shadow tables.

 

*** This bug is a duplicate of bug 1183523 ***
    https://bugs.launchpad.net/bugs/1183523

This affected multiple MOS 7 customers. Please provide fix or
workaround.

** Tags added: ct1

-- 
You received this bug notification because you are a member of Nova,
which is a bug assignee.
https://bugs.launchpad.net/bugs/1562863

Title:
  The command "nova-manage db archive_deleted_rows" doesn't move the
  entries to the shadow tables.

Status in Mirantis OpenStack:
  New

Bug description:
  Once an instance is deleted from the cloud its entry in the database is still present. 
  When trying to archive some number of deleted rows with "nova-manage db archive_deleted_rows --max-rows 1", a constraint error is displayed in nova logs.

  Expected results:
  Specified deleted rows number should be moved from production tables to shadow tables.

  Actual result:
  db-archiving fails to archive specified number of deleted rows with "nova-manage db archive_deleted_rows --max-rows 1", a constraint error is displayed in nova logs:

  2016-03-28 12:31:43.751 14147 ERROR oslo_db.sqlalchemy.exc_filters [req-0fd152a6-b298-4c3c-9aa7-ebdadc752b89 - - - - -] 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, 1)
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters     context)
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters     cursor.execute(statement, parameters)
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters     self.errorhandler(self, exc, value)
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters     raise errorclass, errorvalue
  2016-03-28 12:31:43.751 14147 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`))')
  2016-03-28 12:31:43.751 14147 TRACE oslo_db.sqlalchemy.exc_filters 
  2016-03-28 12:31:43.753 14147 WARNING nova.db.sqlalchemy.api [req-0fd152a6-b298-4c3c-9aa7-ebdadc752b89 - - - - -] IntegrityError detected when archiving table instances

  
  Steps to reproduce:
  1) create instance
  2) delete instance
  3) run command 'nova-manage db archive_deleted_rows --max_rows 1'

  Description of the environment:
      MOS: 7.0
      OS: Ubuntu 14.04 
      Reference architecture: HA
      Network model: Neutron VLAN

To manage notifications about this bug go to:
https://bugs.launchpad.net/mos/+bug/1562863/+subscriptions


References