Cinder throws error creating incremental backup from parent in another project
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
Rodrigo Barbieri | ||
Ubuntu Cloud Archive |
Fix Committed
|
Undecided
|
Unassigned | ||
Stein |
Fix Committed
|
Undecided
|
Unassigned | ||
Train |
Fix Committed
|
Undecided
|
Unassigned | ||
Ussuri |
Fix Committed
|
Undecided
|
Unassigned | ||
Victoria |
Fix Committed
|
Undecided
|
Unassigned | ||
cinder (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Environment: Ubuntu Bionic, OpenStack Train, Volume and Backup Driver Ceph
This bug was also reproduced on Queens.
Steps to reproduce:
1) Create a volume v1 as user demo
2) Create a full backup of v1 as user admin
3) Create an incremental backup of v1 as user demo
4) Result: Backup is created successfully, but error in logs. Logs do not show INFO message and parent_
Expectation: Either no error successfully finishing method create_backup, or not creating backup at all, with backup entity set as Error (see below).
Using POSIX driver, the backup is not created successfully and backup entity remains in error state. The POSIX driver tries to read backup.parent_id before creating the backup therefore raises the error earlier.
Trace:
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
2020-03-30 14:53:21.341 25018 ERROR oslo_messaging.
=======
[Impact]
Whenever an admin creates a backup for a tenant volume, all subsequent incremental backups will have a silent error during creation when linking the dependent backup to its parent because the code detects it has a parent (by listing backups from all projects) but is unable to find the DB entity while scoped to only its project. Upon deleting the child backup, it will hit another silent error (because of lack of link) and it will skip cleaning up the quota for the backup. The quota will then misrepresent the number and size of backups, and the discrepancy will increase as this error is hit for several backups. Ultimately, the user will hit a quota error with a lower number/size of backups than the actual quota limit.
The fix addressed the problem by changing the code that searches for the parent backup. The code will now only search for backups under the same project, so it will prevent the error from happening.
[Test case]
1) Reproducing the bug:
1a) Create a volume v1 as user demo
1b) Create a full backup b1 of v1 as user admin
1c) Create an incremental backup b2 of v1 as user demo
1d) Confirm backup b2 is created successfully
1e) Check log file "/var/log/
cinder.
2) Cleanup not necessary
3) Install package that contains fixed code
4) Confirm bug is fixed
4a) Repeat steps 1a to 1d, make sure to create a new volume and new backups from it.
4b) Check log file "/var/log/
[Regression Potential]
The fix has already been validated in upstream CI with new functional tests that perform that specific workflow (however, checks API backup field instead of logs), as far back as Rocky release. The code changes affect the creation step of backups, and both the new and previously existing functional tests thoroughly test the creation step in different ways, therefore regressions with this patch are not expected.
[Other Info]
For releases older than Train, the fix for bug 1809323 needs to be included as a dependency.
description: | updated |
Changed in cinder: | |
status: | New → Confirmed |
tags: | added: sts |
Changed in cinder: | |
status: | Confirmed → In Progress |
assignee: | nobody → Rodrigo Barbieri (rodrigo-barbieri2010) |
Changed in cinder: | |
milestone: | none → victoria-1 |
description: | updated |
Bug https:/ /bugs.launchpad .net/cinder/ +bug/1869749 is a consequence of this one