Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1796144

Summary: cinder-manage fails to purge deleted volumes due to constraint
Product: Red Hat OpenStack Reporter: Rajat Dhasmana <rdhasman>
Component: openstack-cinderAssignee: Cinder Bugs List <cinder-bugs>
Status: CLOSED EOL QA Contact: Tzach Shefi <tshefi>
Severity: high Docs Contact: Chuck Copello <ccopello>
Priority: medium    
Version: 15.0 (Stein)CC: akaris, amoralej, astillma, dhill, eharney, ltoscano, nchandek, rdhasman, smykhail, tshefi, udesale
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1794693 Environment:
Last Closed: 2020-09-21 10:54:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1565460, 1777906, 1794693    
Bug Blocks:    

Description Rajat Dhasmana 2020-01-29 17:28:21 UTC
+++ This bug was initially created as a clone of Bug #1794693 +++

+++ This bug was initially created as a clone of Bug #1777906 +++

Description of problem:

()[root@overcloud-controller-01 /]# cat /var/spool/cron/cinder 
# HEADER: This file was autogenerated at 2019-11-16 08:33:00 +0000 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: cinder-manage db purge
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 0 * * * cinder-manage db purge 30 >>/var/log/cinder/cinder-rowsflush.log 2>&1
()[root@overcloud-controller-01 /]# cinder-manage db purge 30
Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
Purge command failed, check cinder-manage logs for more details.
()[root@overcloud-controller-01 /]# cinder-manage logs errors
Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
DEPRECATED: The log commands are deprecated since Queens and are not maintained. They will be removed in an upcoming release.
/var/log/cinder/cinder-manage.log:-
Line 14 : 2019-11-28 14:19:10.181 1649 ERROR cinder.db.sqlalchemy.api [req-f9a046ec-1386-4485-948d-3318cc74982a - - - - -] 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_attachment`, CONSTRAINT `volume_attachment_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(2019, 10, 29, 14, 19, 6, 707533)}] (Background on this error at: http://sqlalche.me/e/gkpj).: DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`cinder`.`volume_attachment`, CONSTRAINT `volume_attachment_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(2019, 10, 29, 14, 19, 6, 707533)}] (Background on this error at: http://sqlalche.me/e/gkpj)


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

How reproducible:
Now

Steps to Reproduce:
1. Don't know yet
2.
3.

Actual results:
Fails to archive deleted rows and they are accumulating until cinder-volume stops working

Expected results:
Never fails to archive deleted rows

Additional info:

Comment 4 Luigi Toscano 2020-09-21 10:54:40 UTC
OSP15 is EOL, but this bug has been fixed in OSP16+ and OSP13.