if we firstly create a incremental backup without parent backup, the reserved value of quota_usages table is not rollbacked

Bug #1809323 reported by Leopard Ma
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Brin Zhang

Bug Description

You can use the following steps to reproduce:
1 cinder create --name test 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-12-12T03:04:00.000000 |
| description | None |
| encrypted | False |
| id | 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | test |
| os-vol-host-attr:host | node01@lvmdriver-1#lvmdriver-1 |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 3521efd8be6f43f09e65a05abd32fbbe |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | 2018-12-12T03:04:00.000000 |
| user_id | 1dc213c4fbea4c82b69036d444c20fac |
| volume_type | lvmdriver-1 |
+--------------------------------+--------------------------------------+
2 cinder show 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attached_servers | [] |
| attachment_ids | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-12-12T03:04:00.000000 |
| description | None |
| encrypted | False |
| id | 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61 |
| metadata | |
| migration_status | None |
| multiattach | False |
| name | test |
| os-vol-host-attr:host | node01@lvmdriver-1#lvmdriver-1 |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 3521efd8be6f43f09e65a05abd32fbbe |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2018-12-12T03:04:01.000000 |
| user_id | 1dc213c4fbea4c82b69036d444c20fac |
| volume_type | lvmdriver-1 |
+--------------------------------+--------------------------------------+
3 cinder quota-usage 3521efd8be6f43f09e65a05abd32fbbe
+-----------------------+--------+----------+-------+-----------+
| Type | In_use | Reserved | Limit | Allocated |
+-----------------------+--------+----------+-------+-----------+
| backup_gigabytes | 0 | 0 | 1000 | |
| backups | 0 | 0 | 10 | |
| gigabytes | 2 | 0 | 1000 | |
| gigabytes_lvmdriver-1 | 2 | 0 | -1 | |
| groups | 0 | 0 | 10 | |
| per_volume_gigabytes | 0 | 0 | -1 | |
| snapshots | 0 | 0 | 10 | |
| snapshots_lvmdriver-1 | 0 | 0 | -1 | |
| volumes | 2 | 0 | 10 | |
| volumes_lvmdriver-1 | 2 | 0 | -1 | |
+-----------------------+--------+----------+-------+-----------+
4 cinder backup-create 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61 --incremental
ERROR: Invalid backup: No backups available to do an incremental backup. (HTTP 400) (Request-ID: req-335eb1e6-ac70-45a7-b084-764e4470b1ce)
5 cinder quota-usage 3521efd8be6f43f09e65a05abd32fbbe
+-----------------------+--------+----------+-------+-----------+
| Type | In_use | Reserved | Limit | Allocated |
+-----------------------+--------+----------+-------+-----------+
| backup_gigabytes | 0 | 1 | 1000 | |
| backups | 0 | 1 | 10 | |
| gigabytes | 2 | 0 | 1000 | |
| gigabytes_lvmdriver-1 | 2 | 0 | -1 | |
| groups | 0 | 0 | 10 | |
| per_volume_gigabytes | 0 | 0 | -1 | |
| snapshots | 0 | 0 | 10 | |
| snapshots_lvmdriver-1 | 0 | 0 | -1 | |
| volumes | 2 | 0 | 10 | |
| volumes_lvmdriver-1 | 2 | 0 | -1 | |
+-----------------------+--------+----------+-------+-----------+
5 Repetitive operation step 4 for nine times:
  cinder backup-create 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61 --incremental
6 cinder backup-create 2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61
ERROR: BackupLimitExceeded: Maximum number of backups allowed (10) exceeded (HTTP 413) (Request-ID: req-cf3f4cfc-521e-4115-bbe8-14a031e45718)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/626790

Changed in cinder:
assignee: nobody → Leopard Ma (leopardma)
status: New → In Progress
Changed in cinder:
assignee: Leopard Ma (leopardma) → Brin Zhang (zhangbailin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/626790
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=a62fabfa65bf02ab91ff61ad2b74a6eb7509ee24
Submitter: Zuul
Branch: master

commit a62fabfa65bf02ab91ff61ad2b74a6eb7509ee24
Author: LeopardMa <email address hidden>
Date: Thu Dec 20 20:24:34 2018 -0500

    Rollback the quota_usages table when failed to create a incremental backup

    If we firstly create a incremental backup without parent backup
    or using unavailable backup file, like execute the command:
    ``cinder backup-create --name test_backup --incremental
    2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61``.

    To satisfy one of the above reasons, we will be received an error
    info: "Invalid backup: No backups available to do an incremental
    backup. (HTTP 400)". But the reserved value of the ``quota_usages``
    table has been updated, so we need to roll back the ``quota_usages``
    table. Otherwise, after repetitive operation for many times,
    create backup will be failed.

    Co-Authored-By: Brin Zhang <email address hidden>

    Closes-Bug: #1809323
    Change-Id: I1870633a5505bdb60d529fbda3147378b75e2b07

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 15.0.0.0rc1

This issue was fixed in the openstack/cinder 15.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/739606

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/stein)

Reviewed: https://review.opendev.org/739606
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ef07bc95471101e42d531908a00c242710834784
Submitter: Zuul
Branch: stable/stein

commit ef07bc95471101e42d531908a00c242710834784
Author: LeopardMa <email address hidden>
Date: Thu Dec 20 20:24:34 2018 -0500

    Rollback the quota_usages table when failed to create a incremental backup

    If we firstly create a incremental backup without parent backup
    or using unavailable backup file, like execute the command:
    ``cinder backup-create --name test_backup --incremental
    2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61``.

    To satisfy one of the above reasons, we will be received an error
    info: "Invalid backup: No backups available to do an incremental
    backup. (HTTP 400)". But the reserved value of the ``quota_usages``
    table has been updated, so we need to roll back the ``quota_usages``
    table. Otherwise, after repetitive operation for many times,
    create backup will be failed.

    Co-Authored-By: Brin Zhang <email address hidden>

    Closes-Bug: #1809323
    Change-Id: I1870633a5505bdb60d529fbda3147378b75e2b07
    (cherry picked from commit a62fabfa65bf02ab91ff61ad2b74a6eb7509ee24)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/742220

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/rocky)

Reviewed: https://review.opendev.org/742220
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=29d956c0cee09465730f304cee7cc69dd137f2be
Submitter: Zuul
Branch: stable/rocky

commit 29d956c0cee09465730f304cee7cc69dd137f2be
Author: LeopardMa <email address hidden>
Date: Thu Dec 20 20:24:34 2018 -0500

    Rollback the quota_usages table when failed to create a incremental backup

    If we firstly create a incremental backup without parent backup
    or using unavailable backup file, like execute the command:
    ``cinder backup-create --name test_backup --incremental
    2e3d9d0b-6b33-4cfe-a7c2-656415ee6f61``.

    To satisfy one of the above reasons, we will be received an error
    info: "Invalid backup: No backups available to do an incremental
    backup. (HTTP 400)". But the reserved value of the ``quota_usages``
    table has been updated, so we need to roll back the ``quota_usages``
    table. Otherwise, after repetitive operation for many times,
    create backup will be failed.

    Co-Authored-By: Brin Zhang <email address hidden>

    Closes-Bug: #1809323
    Change-Id: I1870633a5505bdb60d529fbda3147378b75e2b07
    (cherry picked from commit a62fabfa65bf02ab91ff61ad2b74a6eb7509ee24)
    (cherry picked from commit ef07bc95471101e42d531908a00c242710834784)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder rocky-eol

This issue was fixed in the openstack/cinder rocky-eol release.

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.