mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-05-23 15:56:42 +00:00
rbd: add one depth for softlimit of snapshot for restore PVC
Currently, while preparing a volume for snapshot, the depthToAvoidFlatten is set to 2. This accounts one for snapshot and another since parent of the volume is flattened. This commit modifies the depth to 3 to also account for future PVC restore since - snapshot alone is useless and it is very likely to be restore at one point in time. - this ensures snapshot is not flattened when restore does occur. - flattening of snapshot in the above case will make the snapshot no longer eligible for changed block tracking(snap diff) operation. - maintain similarity with PVC-PVC clone operation which currently depthToAvoidFlatten set to 1. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
dd68f1a0bc
commit
6f802589aa
@ -2255,8 +2255,9 @@ func (rv *rbdVolume) PrepareVolumeForSnapshot(ctx context.Context, cr *util.Cred
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// choosing 2, since snapshot adds one depth and we'll be flattening the parent.
|
// choosing 3, since snapshot adds one depth, restore pvc will add one in future
|
||||||
const depthToAvoidFlatten = 2
|
// and we'll be flattening the parent.
|
||||||
|
const depthToAvoidFlatten = 3
|
||||||
if rbdHardMaxCloneDepth > depthToAvoidFlatten {
|
if rbdHardMaxCloneDepth > depthToAvoidFlatten {
|
||||||
hardLimit = rbdHardMaxCloneDepth - depthToAvoidFlatten
|
hardLimit = rbdHardMaxCloneDepth - depthToAvoidFlatten
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user