The command "cinder-manage db purge age_in_days 1" fails in the current Ocata release with foreign key constraint violation:
"Purge command failed, check cinder-manage logs for more details."
cinder-manage.log:
2017-03-09 06:55:24.200 18611 ERROR cinder.db.sqlalchemy.api [req-a3075d7f-0fc8-4b33-9868-9cd018198fed - - - - -] DBError detected when purging from volumes: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`cinder`.`volume_admin_metadata`, CONSTRAINT `volume_admin_metadata_ibfk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`))') [SQL: u'DELETE FROM volumes WHERE volumes.deleted_at < %(deleted_at_1)s'] [parameters: {u'deleted_at_1': datetime.datetime(2017, 3, 8, 5, 55, 24, 132310)}].
May someone please have a look.
Tested this on Master..
I see from the logs of db Purge command that volume_metadata & volume_ admin_metadata are purged before the volumes itself.
So all the rows in volume_ admin_metadata marked as (deleted, deleted_at) should be purged before the volumes themselves.
I believe there must have been a delay between a.) & b.): admin_metadata as deleted
a.) marking volume as deleted
b.) marking volume_
Because of this purge command purged the volume before volume_ admin_metadata. I dont think this would happen quite often. Want to wait and hear from others!