Cinder leaves quota usage when deleting incremental backup with parent from another project

Bug #1869749 reported by Rodrigo Barbieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

The root cause for this bug is https://bugs.launchpad.net/cinder/+bug/1869746

However, the code could be improved to prevent this specific problem from happening regardless of that bug.

Environment: Same as bug 1869746

This bug was also reproduced on Queens.

Steps to reproduce:

1) Run same steps as bug 1869746
2) Try to delete the backup created.
3) Result: Backup is deleted successfully, but an error is thrown in the logs and quota used by backup is not restored on [0].

Expectation: Delete the backup without errors and successfully restore the quota. Quota should be restored as soon as backup is deleted.

Trace:

2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server [req-5e034fe6-0844-4b61-a03c-b6d0bc605b00 3bee8c02ecce4744af287b3b8dd40ca5 9370e1e898214d88bd9eda4f88eccba9 - f883c6315a004471b2ab1b04d8a111d9 f883c6315a004471b2ab1b04d8a111d9] Exception during message handling: cinder.exception.BackupNotFound: Backup 7a15b9ec-7648-483f-ad32-6074567eca2a could not be found.
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/dispatcher.py", line 274, in dispatch
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/backup/manager.py", line 780, in delete_backup
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server backup.parent_id)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/objects/base.py", line 352, in get_by_id
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server orm_obj = db.get_by_id(context, cls.model, id, *args, **kwargs)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/api.py", line 1801, in get_by_id
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server return IMPL.get_by_id(context, model, id, *args, **kwargs)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 189, in wrapper
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server return f(*args, **kwargs)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 7125, in get_by_id
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server return _GET_METHODS[model](context, id, *args, **kwargs)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 189, in wrapper
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server return f(*args, **kwargs)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 5154, in backup_get
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server project_only=project_only)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 5165, in _backup_get
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server raise exception.BackupNotFound(backup_id=backup_id)
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server cinder.exception.BackupNotFound: Backup 7a15b9ec-7648-483f-ad32-6074567eca2a could not be found.
2020-03-30 14:56:38.431 25018 ERROR oslo_messaging.rpc.server

[0] https://github.com/openstack/cinder/blob/e79b98367bd72f0323258dc0506de28b31c4aa48/cinder/backup/manager.py#L786

Tags: sts
Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote :

This is a consequence of bug https://bugs.launchpad.net/cinder/+bug/1869749 but could be improved to handle quotas in a better way when deleting backups

tags: added: sts
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.