Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd: include trashed parent images while calculating the clone depth #4029

Draft
wants to merge 8 commits into
base: devel
Choose a base branch
from

Commits on Dec 1, 2023

  1. rbd: use librbd.OpenImageById() if rbdVol.ImageID is set

    `librbd.OpenImageById()` works if the image is in the trash, so it makes
    it possible to get the parent of the image.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    f83da27 View commit details
    Browse the repository at this point in the history
  2. rbd: prevent presetting the ImageID of a new volume

    When a new volume is not created yet, the ImageID should not be set to
    the ID of the snapshot.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    b78dcd5 View commit details
    Browse the repository at this point in the history
  3. rbd: set/get correct ImageID in more places

    In some places the ImageID is used as the ID of the parent. That is very
    confusing and prone to errors. Instead, fetch the right ImageID where
    possible, and set ParentID for referencing to parent images.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    e1cd7a5 View commit details
    Browse the repository at this point in the history
  4. rbd: skip flattening if an image in trash

    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    9ac559c View commit details
    Browse the repository at this point in the history
  5. rbd: the DeleteVolume CSI procedure should succeed on deleted images

    If the RBD-image is deleted already, the DeleteVolume CSI procedure is
    expected to report success (as it should be idempotent). In case the
    returned error indicates "RBD image not found", the error is ignored and
    the DeleteVolume procedure continues.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    2a9d723 View commit details
    Browse the repository at this point in the history
  6. rbd: include trashed parent images while calculating the clone depth

    The `getCloneDepth()` function did not account for images that are in
    the trash. A trashed image can only be opened by the image-id, and not
    by name anymore.
    
    Closes: ceph#4013
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    f18c571 View commit details
    Browse the repository at this point in the history
  7. rbd: pass a max-depth to getCloneDepth()

    The `getCloneDepth()` function does not need to traverse the whole chain
    of parents when a certain max-limit is configured. The traversing can be
    aborted once the hard-limit is reached. This makes the procedure a
    little more efficient, as unnecessary traversing is prevented.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    b8a5675 View commit details
    Browse the repository at this point in the history
  8. rbd: return CSI expected errors while flattening a snapshot or volume

    By returned `ABORTED` or `PRECONDITION_FAILED` in the right places, the
    CO will retry with the same arguments until the snapshot is
    `ReadyToUse`. This causes restoring a volume from a snapshot to be
    delayed, until the snapshot can be used.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    a29bea6 View commit details
    Browse the repository at this point in the history