mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
rbd: add layering & deep flattenfeatures for groupsnapshot image
Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
09d848e017
commit
50b2a0528e
@ -629,8 +629,10 @@ func flattenTemporaryClonedImages(ctx context.Context, rbdVol *rbdVolume, cr *ut
|
|||||||
}
|
}
|
||||||
// If we start flattening all the snapshots at one shot the volume
|
// If we start flattening all the snapshots at one shot the volume
|
||||||
// creation time will be affected,so we will flatten only the extra
|
// creation time will be affected,so we will flatten only the extra
|
||||||
// snapshots.
|
// snapshots. Use the min of the extra snapshots and the number of children
|
||||||
extraSnapshots := min(len(snaps)-int(minSnapshotsOnImageToStartFlatten), len(children))
|
// to avoid scenario where number of children are less than the extra snapshots.
|
||||||
|
// This occurs when the child images are in trash and not yet deleted.
|
||||||
|
extraSnapshots := min((len(snaps) - int(minSnapshotsOnImageToStartFlatten)), len(children))
|
||||||
children = children[:extraSnapshots]
|
children = children[:extraSnapshots]
|
||||||
err = flattenClonedRbdImages(
|
err = flattenClonedRbdImages(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -276,6 +276,10 @@ func (rv *rbdVolume) NewSnapshotByID(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the features for the clone image.
|
||||||
|
f := []string{librbd.FeatureNameLayering, librbd.FeatureNameDeepFlatten}
|
||||||
|
rv.ImageFeatureSet = librbd.FeatureSetFromNames(f)
|
||||||
|
|
||||||
options, err := rv.constructImageOptions(ctx)
|
options, err := rv.constructImageOptions(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user