cinder delete backup failed due to incremental in rbd backend

Bug #1824948 reported by Henry
14
This bug affects 3 people
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-1b3b-414a-98c4-b5d8dbb72085 | available | dev-vol | 1 | - | false | |
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
[root@rocky-dev ~]# cinder backup-create 3597d86c-1b3b-414a-98c4-b5d8dbb72085 --name bak1
+-----------+--------------------------------------+
| Property | Value |
+-----------+--------------------------------------+
| id | de0d93c4-5c2f-470c-9e2a-37ee019fe7ab |
| name | bak1 |
| volume_id | 3597d86c-1b3b-414a-98c4-b5d8dbb72085 |
+-----------+--------------------------------------+
[root@rocky-dev ~]# cinder backup-show de0d93c4-5c2f-470c-9e2a-37ee019fe7ab |grep incremen
| is_incremental | False |
[root@rocky-dev ~]# cinder backup-create 3597d86c-1b3b-414a-98c4-b5d8dbb72085 --name bak2
+-----------+--------------------------------------+
| Property | Value |
+-----------+--------------------------------------+
| id | 7ae9c9e8-3d0e-4b04-ae1c-66baa449fdc7 |
| name | bak2 |
| volume_id | 3597d86c-1b3b-414a-98c4-b5d8dbb72085 |
+-----------+--------------------------------------+
[root@rocky-dev ~]# cinder backup-show 7ae9c9e8-3d0e-4b04-ae1c-66baa449fdc7 |grep incremen
| is_incremental | True |
[root@rocky-dev ~]# cinder backup-create 3597d86c-1b3b-414a-98c4-b5d8dbb72085 --name bak3
+-----------+--------------------------------------+
| Property | Value |
+-----------+--------------------------------------+
| id | 430fe9be-0837-4cde-8b2d-64a21ed43cf8 |
| name | bak3 |
| volume_id | 3597d86c-1b3b-414a-98c4-b5d8dbb72085 |
+-----------+--------------------------------------+
[root@rocky-dev ~]# cinder backup-show 430fe9be-0837-4cde-8b2d-64a21ed43cf8 |grep incremen
| 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-2358-478f-8da7-600fe5c175a9)
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.

Henry (guanzy)
Changed in cinder:
assignee: nobody → Henry (guanzy)
Revision history for this message
Eric Harney (eharney) wrote :

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.

Changed in cinder:
assignee: Henry (guanzy) → nobody
Revision history for this message
Henry (guanzy) wrote :

In incremental backup, parent_id always specifies latest_backup. While,the latest_backup can not be remove until all the subsequent backups has been removed.
This is not appropriate in some situation, such as auto remove some old backups.

Revision history for this message
Markus Küffner (mkuf) wrote :

It seems that the backup driver sets the parent_id falsely to the previous backup instead of the actual base.

This also causes is_incremental to be set to true, even if in fact the backup is a diff.

As Henry stated, this is makes it a lot more complicated to get rid of old backups.

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.