← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1584702] Re: IntegrityError occurs in archiving tables after a resized VM instance was deleted

 

Reviewed:  https://review.openstack.org/323684
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1dfd79495e565eda3997b0a272c594a8d2c422d4
Submitter: Jenkins
Branch:    master

commit 1dfd79495e565eda3997b0a272c594a8d2c422d4
Author: Takashi NATSUME <natsume.takashi@xxxxxxxxxxxxx>
Date:   Thu Sep 15 09:21:10 2016 +0900

    Fix an error in archiving 'migrations' table
    
    Add soft deleting 'migrations' table when the VM instance is deleted.
    And add soft deleting 'migrations' table when archiving deleted rows
    for the case to upgrade.
    
    Change-Id: Ica35ce2628dfcf412eb097c2c61fdde8828e9d90
    Closes-Bug: #1584702


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1584702

Title:
  IntegrityError occurs in archiving tables after a resized VM instance
  was deleted

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  After a resized VM instance was deleted, IntegrityError occurs when
  archiving tables (nova-manage db archive_deleted_rows).

  [How to reproduce]
  stack@devstack-master:~/nova$ openstack server list
  +--------------------------------------+---------+--------+--------------------------------+
  | ID                                   | Name    | Status | Networks                       |
  +--------------------------------------+---------+--------+--------------------------------+
  | 3a77cd99-3ee0-45af-a301-1016907efaba | server1 | ACTIVE | public=10.0.2.195, 2001:db8::3 |
  +--------------------------------------+---------+--------+--------------------------------+
  stack@devstack-master:~/nova$ openstack server resize --flavor m1.small server1
  stack@devstack-master:~/nova$ openstack server resize --confirm server1
  stack@devstack-master:~/nova$ openstack server delete server1

  mysql> select instance_uuid, migration_type, status, deleted from migrations;
  +--------------------------------------+----------------+-----------+---------+
  | instance_uuid                        | migration_type | status    | deleted |
  +--------------------------------------+----------------+-----------+---------+
  | 3a77cd99-3ee0-45af-a301-1016907efaba | resize         | confirmed |       0 |
  +--------------------------------------+----------------+-----------+---------+
  1 row in set (0.00 sec)

  mysql> select uuid, deleted from instances;
  +--------------------------------------+---------+
  | uuid                                 | deleted |
  +--------------------------------------+---------+
  | 3a77cd99-3ee0-45af-a301-1016907efaba |       1 |
  +--------------------------------------+---------+
  1 row in set (0.00 sec)

  stack@devstack-master:~/nova$ nova-manage db archive_deleted_rows 1000
  2016-05-23 19:23:08.434 WARNING nova.db.sqlalchemy.api [-] IntegrityError detected when archiving table instances: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`migrations`, CONSTRAINT `fk_migrations_instance_uuid` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))') [SQL: u'DELETE FROM instances WHERE instances.id in (SELECT T1.id FROM (SELECT instances.id \nFROM instances \nWHERE instances.deleted != %(deleted_1)s ORDER BY instances.id \n LIMIT %(param_1)s) as T1)'] [parameters: {u'param_1': 971, u'deleted_1': 0}]

  mysql> select instance_uuid, migration_type, status, deleted from migrations;
  +--------------------------------------+----------------+-----------+---------+
  | instance_uuid                        | migration_type | status    | deleted |
  +--------------------------------------+----------------+-----------+---------+
  | 3a77cd99-3ee0-45af-a301-1016907efaba | resize         | confirmed |       0 |
  +--------------------------------------+----------------+-----------+---------+
  1 row in set (0.00 sec)

  mysql> select uuid, deleted from instances;
  +--------------------------------------+---------+
  | uuid                                 | deleted |
  +--------------------------------------+---------+
  | 3a77cd99-3ee0-45af-a301-1016907efaba |       1 |
  +--------------------------------------+---------+
  1 row in set (0.00 sec)

  [Environment]
  OS: Ubuntu 14.04 LTS(64bit)
  nova: master (commit 2505c5d8b1d9c075e20275ee903657640cc97c92)

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


References