Skip to content

Commit

Permalink
rbd: set depthToAvoidFlatten to 3 during PVC-PVC clone
Browse files Browse the repository at this point in the history
During PVC-PVC clone creation, parent of the datasource
image is flattened after checking for clone depth.
We need to account for data source image as well since
we're calculating depth from the parent image.
depthToAvoidFlatten = 3(datasource image + temp + final clone)

Signed-off-by: Rakshith R <[email protected]>
  • Loading branch information
Rakshith-R committed Nov 14, 2024
1 parent 853210d commit a08188c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ func flattenParentImage(
hardLimit := rbdHardMaxCloneDepth
softLimit := rbdSoftMaxCloneDepth
if rbdVol != nil {
// choosing 2, since cloning image creates a temp clone and a final clone which
// will add a total depth of 2.
const depthToAvoidFlatten = 2
// choosing 3, since cloning image creates a temp clone and a final clone which
// will add a total depth of 2 and the parent image itself adds one depth.
const depthToAvoidFlatten = 3
if rbdHardMaxCloneDepth > depthToAvoidFlatten {
hardLimit = rbdHardMaxCloneDepth - depthToAvoidFlatten
}
Expand Down

0 comments on commit a08188c

Please sign in to comment.