[Bug 1969643] Fix merged to cinder (stable/2023.1)

OpenStack Infra 1969643 at bugs.launchpad.net
Thu Oct 24 16:32:06 UTC 2024


Reviewed:  https://review.opendev.org/c/openstack/cinder/+/931989
Committed: https://opendev.org/openstack/cinder/commit/f56f9ed6d257840bfb477149deba28972dbd4e74
Submitter: "Zuul (22348)"
Branch:    stable/2023.1

commit f56f9ed6d257840bfb477149deba28972dbd4e74
Author: Eric Harney <eharney at redhat.com>
Date:   Wed Apr 20 12:08:31 2022 -0400

    RBD: Flattening of child volumes during deletion
    
    This patch allows delete_volume and delete_snapshot calls
    to fail less often when using RBD volume clones and snapshots.
    
    RBD clone v2 support allows remove() to pass in situations
    where it would previously fail, but it still fails with an
    ImageBusy error in some situations.  For example:
    
     volume1
       -> snapshot s1 of volume 1
         -> volume2 cloned from snapshot 1
    Deleting snapshot s1 would fail with ImageBusy.
    
    This is fixed by using RBD flatten operations to break
    dependencies between volumes/snapshots and other RBD volumes
    or snapshots.
    
    Delete now works as follows:
      1. Attempt RBD remove()
         This is the "fast path" for removing a simple volume
         that involves no extra overhead.
      2. If busy and the volume has child dependencies,
         flatten those dependencies with RBD flatten()
      3. Attempt RBD remove() again
         This will succeed in more cases than (1) would have.
      4. If remove() failed, use trash_move() instead to move
         the image to the trash instead.
         This allows Cinder deletion of a volume (volume1) to proceed
         in the scenario where volume2 was cloned from snapshot s1 of
         volume1, and snapshot s1 has been trashed and not fully
         deleted from the RBD backend.  (Snapshots in the trash
         namespace are no longer visible but are still in the
         dependency chain.)
    
    This allows Cinder deletions to succeed in most scenarios where
    they would previously fail.
    
    In cases where a .clone_snap snapshot is present, we still do a
    rename to .deleted instead of deleting/trashing the volume.  This
    should be worked on further in a follow-up as it is likely not
    necessary most of the time.
    
    A new configuration option, rbd_concurrent_flatten_operations, was
    introduced to limit how many flatten calls can be made at the same time.
    This is to prevent overloading the backend. The default value is 3.
    
    Co-Authored-By: Eric Harney <eharney at redhat.com>
    Co-Authored-By: Sofia Enriquez <lsofia.enriquez at gmail.com>
    
    Closes-Bug: #1969643
    Change-Id: I009d0748fdc829ca0b4f99bc9b70dadd19717d04
    (cherry picked from commit 1a675c9aa178c6d9c6ed10fd98f086c46d350d3f)
    (cherry picked from commit ab92378c47b4add7744b8841e096d0d99830b0f1)

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to cinder in Ubuntu.
https://bugs.launchpad.net/bugs/1969643

Title:
  RBD: Unable to delete a volume which has snapshot/volume children

Status in Cinder:
  Fix Released
Status in cinder package in Ubuntu:
  Fix Released
Status in cinder source package in Jammy:
  Incomplete
Status in cinder source package in Mantic:
  Won't Fix
Status in cinder source package in Noble:
  Fix Released
Status in cinder source package in Oracular:
  Fix Released

Bug description:
  [Impact]
  Deleting a volume will fail if it has snapshot or volume children, resulting in an ImageBusy error.

  [Fix]
  Upstream has a patch that uses RBD flatten operations to break dependencies between volumes and snapshots, reducing failures when using RBD volume clones and snapshots.

  commit 1a675c9aa178c6d9c6ed10fd98f086c46d350d3f
  Author:     Eric Harney <eharney at redhat.com>
  CommitDate: Fri Dec 1 10:17:05 2023 -0500

      RBD: Flattening of child volumes during deletion

  [Test Plan]
  Here are the common steps for testing.
  1. Prepare an OpenStack environment with cinder-ceph
  2. Create a volume named "vol"
  openstack volume create --image jammy --size 10 vol
  3. Create a snapshot of the volume "vol"
  openstack volume snapshot create --volume vol vol-snap
  4. Create a volume named "vol-copy" from the snapshot
  openstack volume create --snapshot vol-snap vol-copy
  5. Delete the snapshot and then delete the volume "vol"
  openstack volume snapshot delete vol-snap
  openstack volume delete vol
  6. Confirm that the volume "vol" is successfully deleted
  or deletion failed (depending on the two scenarios below)
  openstack volume list

  There are two test scenarios:
  - Enable RBD flatten operations:
  1. Use `juju ssh` to log in to the cinder-volume and add "enable_flatten_children_deletion = True" in the cinder-ceph section of /etc/cinder/cinder.conf.
  2. Restart the cinder-volume service using the command `systemctl restart cinder-volume`.
  3. Follow the common steps, and all steps should pass.
  - Disable RBD flatten operations:
  1. Ensure that "enable_flatten_children_deletion = True" is not present in the cinder-ceph section of /etc/cinder/cinder.conf.
  2. Follow the common steps, and the process should fail at step 5 with an ImageBusy error.

  [Where problems could occur]
  The patch primarily modifies the workflow for volume deletion when using RBD as the backend and adds a retry mechanism for unprotecting snapshots during snapshot deletion.
  To prevent any performance regressions, we have also introduced a configuration option to enable the RBD flatten operations, which defaults to false.
  If the patch has any undiscovered issues, it will only affect volume deletion. Other functionalities or non-RBD backends will not be impacted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1969643/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list