cinder delete backup failed due to incremental in rbd backend
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Undecided
|
Unassigned |
Bug Description
openstack: rocky
cinder: 13.0.3
I created 3 backup for volume "dev-vol", by default the first is full backup and then would create incremental backup in rbd backend, as the display in cinder backup-show is_incremental:
[root@rocky-dev ~]# cinder list
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 3597d86c-
+------
[root@rocky-dev ~]# cinder backup-create 3597d86c-
+------
| Property | Value |
+------
| id | de0d93c4-
| name | bak1 |
| volume_id | 3597d86c-
+------
[root@rocky-dev ~]# cinder backup-show de0d93c4-
| is_incremental | False |
[root@rocky-dev ~]# cinder backup-create 3597d86c-
+------
| Property | Value |
+------
| id | 7ae9c9e8-
| name | bak2 |
| volume_id | 3597d86c-
+------
[root@rocky-dev ~]# cinder backup-show 7ae9c9e8-
| is_incremental | True |
[root@rocky-dev ~]# cinder backup-create 3597d86c-
+------
| Property | Value |
+------
| id | 430fe9be-
| name | bak3 |
| volume_id | 3597d86c-
+------
[root@rocky-dev ~]# cinder backup-show 430fe9be-
| is_incremental | True |
While it failed when delete bak2, due to the incremental backups(bak3) exist for this backup:
[root@rocky-dev ~]# cinder backup-delete bak2
Delete for backup bak2 failed: Invalid backup: Incremental backups exist for this backup. (HTTP 400) (Request-ID: req-cfa0a03b-
ERROR: Unable to delete any of the specified backups.
In cinder, api would check parent_id in database,the backup which specified by other backup's parent_id would not be allowed to delete.
It would like that we got a chain in backups:
base -> bak1 -> bak2 -> bak3
But actually in rbd backups pool, bak snap only depends on the base image and not pre one snap. Base image in backups equals the source volume, so the snap was from source volume, too.
The incremental was created by rbd differential data, it support remove any of backups, not restricted by dependency.
This is important for making policy to clean old backups automatically.
Changed in cinder: | |
assignee: | nobody → Henry (guanzy) |
https:/ /review. openstack. org/#/c/ 627941/ is the first step in getting rbd incremental backup working better in general, and will likely help with this.