Skip to content

Commit

Permalink
Add namespace to index mount directories for server ClientMounts
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Feb 1, 2024
1 parent 456ff6b commit 3e7c051
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion internal/controller/nnf_access_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,24 @@ func (r *NnfAccessReconciler) mapClientLocalStorage(ctx context.Context, access
// If no ClientReference exists, then the mounts are for the Rabbit nodes. Use references
// to the NnfNodeStorage resource so the client mounter can access the swordfish objects
if access.Spec.ClientReference == (corev1.ObjectReference{}) {
// For rabbit mounts, use unique index mount directories that consist of
// <namespace>-<index>. These unique directories guard against potential data
// loss when doing copy out data movement operations. Having the namespace
// (rabbit name) included in the mount path ensures that these individual
// compute mount points are always unique.
//
// Ex: /mnt/nnf/7b5dda61-9d91-4b50-a0d3-f863d0aac25b-0/rabbit-node-1-0
// /mnt/nnf/7b5dda61-9d91-4b50-a0d3-f863d0aac25b-0/rabbit-node-2-0
// If you did not include the namespace, then the paths would be:
// /mnt/nnf/7b5dda61-9d91-4b50-a0d3-f863d0aac25b-0/0
// /mnt/nnf/7b5dda61-9d91-4b50-a0d3-f863d0aac25b-0/0
// When data movement copies the MountPathPrefix to global lustre, then the
// contents of these directories are merged together and potential data loss can
// occur if the contents do not have unique filenames.
indexMountDir := fmt.Sprintf("%s-%s", nnfNodeStorage.Namespace, strconv.Itoa(i))
mountInfo.MountPath = filepath.Join(access.Spec.MountPathPrefix, indexMountDir)

mountInfo.Device.Type = dwsv1alpha2.ClientMountDeviceTypeReference
mountInfo.MountPath = filepath.Join(access.Spec.MountPathPrefix, strconv.Itoa(i))
} else {
mountInfo.MountPath = access.Spec.MountPath
mountInfo.Device.Type = dwsv1alpha2.ClientMountDeviceTypeLVM
Expand Down

0 comments on commit 3e7c051

Please sign in to comment.