yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #51382
[Bug 1584702] [NEW] IntegrityError occurs in archiving tables after a resized VM instance was deleted
Public bug reported:
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)
** Affects: nova
Importance: Undecided
Assignee: Takashi NATSUME (natsume-takashi)
Status: New
** Changed in: nova
Assignee: (unassigned) => Takashi NATSUME (natsume-takashi)
--
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):
New
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
Follow ups