Skip to content

rbd: CephCSI cannot determine correct clone depth in certain case #4013

Open
@Rakshith-R

Description

@Rakshith-R

Describe the bug

If parent PVC of snapshot/ restore/clone pvc is deleted,
then

func (ri *rbdImage) getCloneDepth(ctx context.Context) (uint, error) {

will not work as intended.
Therefore, the clone depth returned is not correct since this function requires all parent images in chain to be present in cluster(deleted parent images will be trash).

One side affect is the issue described here rook/rook#12312.
Creating a chain of clone/snapshot+restore and deleting parent snapshot and PVC renders the final child PVC
to be unmountable.

Environment details

  • Image/version of Ceph CSI driver : All supported cephcsi versions.
  • Helm chart version : -
  • Kernel version : -
  • Mounter used for mounting PVC (for cephFS its fuse or kernel. for rbd its
    krbd or rbd-nbd) : krbd
  • Kubernetes cluster version : all
  • Ceph cluster version : all

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a chain of clones/ snapshot+restores
  2. Delete parent snapshot/clone immediately after child pvc/snapshot creation
  3. Try to mount child PVC to a pod.

Actual results

rbd map fails with the below error:

E0531 18:09:09.891563 15892 utils.go:210] ID: 198 Req-ID: 0001-0009-rook-ceph-0000000000000001-8b978541-8495-4c20-bcab-0a42fa927b5a GRPC error: rpc error: code = Internal desc = rbd: map failed with error an error (exit status 22) occurred while running rbd args: [--id csi-rbd-node -m 10.110.0.127:6789,10.109.223.145:6789,10.108.43.136:6789 --keyfile=***stripped*** map replicapool/csi-vol-8b978541-8495-4c20-bcab-0a42fa927b5a --device-type krbd --options noudev], rbd error output: rbd: sysfs write failed rbd: map failed: (22) Invalid argument

Expected behavior

No error.

Workaround

Flatten the child PVC image manually.

Possible Solution

From CephCSI point of view, we have no other to determine clone depth.
We need a API change possibly in rbd image info providing us with clone depth from ceph.

cc @ceph/ceph-csi-contributors

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponent/rbdIssues related to RBDdependency/go-cephdepends on go-ceph functionalitykeepaliveThis label can be used to disable stale bot activiity in the repo

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions