Snapshot quota usage sync counts temporary snapshots

Bug #1923828 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Gorka Eguileor

Bug Description

When Cinder syncs the quota usage for snapshots it is incorrectly counting temporary snapshots created for backup and revert operations.

Tags: quota
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/786385

Changed in cinder:
status: New → In Progress
Revision history for this message
Gorka Eguileor (gorka) wrote :
Changed in cinder:
importance: Medium → Undecided
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/786385
Committed: https://opendev.org/openstack/cinder/commit/94dfad99c2b39c594cbce2b9387d55a08594fa2b
Submitter: "Zuul (22348)"
Branch: master

commit 94dfad99c2b39c594cbce2b9387d55a08594fa2b
Author: Gorka Eguileor <email address hidden>
Date: Wed Apr 7 11:58:20 2021 +0200

    Improve quota usage for temporary resources

    Cinder creates temporary resources, volumes and snapshots, during some
    of its operations, and these resources aren't counted towards quota
    usage.

    Cinder currently has a problem to track quota usage is when deleting
    temporary resources.

    Determining which volumes are temporary is a bit inconvenient because we
    have to check the migration status as well as the admin metadata, so
    they have been the source of several bugs, though they should be
    properly tracked now.

    For snapshots we don't have any way to track which ones are temporary,
    which creates some issues:

    - Quota sync mechanism will count them as normal snapshots.

    - Manually deleting temporary snapshots after an operation fails will
      mess the quota.

    - If we are using snapshots instead of clones for backups of in-use
      volumes the quota will be messed on completion.

    This patch proposes the introduction of a new field for those database
    resource tables where we create temporary resources: volumes and
    snaphots.

    The field will be called "use_quota" and will be set to False for
    temporary resources to indicate that we don't want them to be counted
    towards quota on deletion.

    Instead of using "temporary" as the field name "use_quota" was used to
    allow other cases that should not do quota in the future.

    Moving from our current mechanism to the new one is a multi-release
    process because we need to have backward compatibility code for rolling
    upgrades.

    This patch adds everything needed to complete the multi-release process
    so that anybody can submit next release patches. To do so the patch
    adds backward compatible code adding the feature in this release and
    TODO comments with the exact changes that need to be done for the next
    2 releases.

    The removal of the compatibility code will be done in the next release,
    and in the one after that we'll remove the temporary metadata rows that
    may still exist in the database.

    With this new field we'll be able to make our DB queries more efficient
    for quota usage calculations, reduce the chances of introducing new
    quota usage bugs in the future, and allow users to filter in/out
    temporary volumes on listings.

    Closes-Bug: #1923828
    Closes-Bug: #1923829
    Closes-Bug: #1923830
    Implements: blueprint temp-resources
    Change-Id: I98bd4d7a54906b613daaf14233d749da1e1531d5

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

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

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

Other bug subscribers

Related blueprints

Remote bug watches

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