Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Use the filesystem from the object cache when unmounting / mounting filesystems. #1978

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions chroma_core/models/client_mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,17 @@ def description(self):
def get_steps(self):
search = lambda cm: (cm.host == self.host and cm.state == "unmounted")
unmounted = ObjectCache.get(LustreClientMount, search)
args = dict(host=self.host, filesystems=[(m.filesystem.mount_path(), m.mountpoint) for m in unmounted])
args = {
"host": self.host,
"filesystems": [
(
ObjectCache.get_one(ManagedFilesystem, lambda mf, mtd=m: mf.name == mtd.filesystem).mount_path(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference comparing to the above two lines (search= and unmounted=)?

Copy link
Contributor Author

@johnsonw johnsonw Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unmounted is a list of unmount LustreClientMount objects. We loop through each of these and match on the filesystem whose name in the umounted client mount objects matches the filesystem name. That will then give a list of filesystems that correspond to the mounts. For example, say we have:

Filesystems:
fs1, fs2, and fs3.

Mounts:
mnt1, mnt2

mnt1 is associated with fs1
mnt2 is associated with fs2

We unmount both of these instances but their object still exists. We then later want to mount them. The expression would return a list with:
[fs1 mount path, fs2 mount path]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem i'm working through at the moment is that the mount path is erased when a client is unmounted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can (should) be in a separate patch.

m.mountpoint,
)
for m in unmounted
],
}

return [(MountLustreFilesystemsStep, args)]


Expand Down Expand Up @@ -353,5 +363,15 @@ def description(self):
def get_steps(self):
search = lambda cm: (cm.host == self.host and cm.state == "mounted")
mounted = ObjectCache.get(LustreClientMount, search)
args = dict(host=self.host, filesystems=[(m.filesystem.mount_path(), m.mountpoint) for m in mounted])
args = {
"host": self.host,
"filesystems": [
(
ObjectCache.get_one(ManagedFilesystem, lambda mf, mtd=m: mf.name == mtd.filesystem).mount_path(),
m.mountpoint,
)
for m in mounted
],
}

return [(UnmountLustreFilesystemsStep, args)]