journal: pass groupUUID to be used for omap name reserve

This commit adds groupUUID param for `ReserveName` to be used for
OMAP name reserve instead of auto-generating.
This is useful for mirroring and metro-DR ensuring that mirrored
resources have consistent OMAP names across mirrored clusters.

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2024-08-05 17:55:12 +05:30
committed by mergify[bot]
parent ce767fe891
commit df4d2eb915
3 changed files with 7 additions and 5 deletions

View File

@ -144,7 +144,7 @@ func (mgr *rbdManager) getGroupUUID(
} else {
log.DebugLog(ctx, "the journal does not contain a reservation for group %q yet", name)
uuid, _ /*vgsName*/, err = vgJournal.ReserveName(ctx, journalPool, name, prefix)
uuid, _ /*vgsName*/, err = vgJournal.ReserveName(ctx, journalPool, name, uuid, prefix)
if err != nil {
return "", nothingToUndo, fmt.Errorf("failed to reserve a UUID for group %q: %w", name, err)
}
@ -273,7 +273,7 @@ func (mgr *rbdManager) CreateVolumeGroup(ctx context.Context, name string) (type
log.DebugLog(ctx, "the journal does not contain a reservation for a volume group with name %q yet", name)
var vgName string
uuid, vgName, err = vgJournal.ReserveName(ctx, journalPool, name, prefix)
uuid, vgName, err = vgJournal.ReserveName(ctx, journalPool, name, uuid, prefix)
if err != nil {
return nil, fmt.Errorf("failed to reserve volume group for name %q: %w", name, err)
}