mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
journal: add volumeMap to the group
instead of adding single volumes to the group journal, support adding multiple volumeID's map to the group journal which is required for RBD as well. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
fc0a7d2542
commit
f8fbf2e95a
@ -461,11 +461,13 @@ func (cs *ControllerServer) createSnapshotAndAddMapping(
|
||||
}
|
||||
defer j.Destroy()
|
||||
// Add the snapshot to the volume group journal
|
||||
err = j.AddVolumeMapping(ctx,
|
||||
err = j.AddVolumesMapping(ctx,
|
||||
vgo.MetadataPool,
|
||||
vgs.ReservedID,
|
||||
req.GetSourceVolumeId(),
|
||||
resp.GetSnapshot().GetSnapshotId())
|
||||
map[string]string{
|
||||
req.GetSourceVolumeId(): resp.GetSnapshot().GetSnapshotId(),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
log.ErrorLog(ctx, "failed to add volume snapshot mapping: %v", err)
|
||||
// Delete the last created snapshot as its still not added to the
|
||||
@ -640,7 +642,7 @@ func (cs *ControllerServer) deleteSnapshotsAndUndoReservation(ctx context.Contex
|
||||
return err
|
||||
}
|
||||
// remove the entry from the omap
|
||||
err = j.RemoveVolumeMapping(
|
||||
err = j.RemoveVolumesMapping(
|
||||
ctx,
|
||||
vgo.MetadataPool,
|
||||
vgsi.ReservedID,
|
||||
|
Reference in New Issue
Block a user