-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lfs): make HSM interactions more robust #210
Merged
Merged
+412
−157
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Draft while I do some testing on cedar... |
I'm going to leave this as a draft until /nearline gets fixed and I can test the |
ketiltrout
force-pushed
the
restoring
branch
2 times, most recently
from
November 6, 2024 21:47
f292d56
to
9378aa8
Compare
ketiltrout
changed the title
fix(lfs): use hsm_action to track in-progress restores
fix(lfs): make HSM interactions more robust
Nov 6, 2024
ketiltrout
added a commit
that referenced
this pull request
Nov 7, 2024
Something I found while testing #210: If we want db._base.threadsafe to be imported into `__init__`, it can't be a scalar (because it's going to change after the import). Instead, make it a function. Bonus: no need to try to import `subprocess` every time a command is run. Just import it once at module import.
ketiltrout
force-pushed
the
restoring
branch
5 times, most recently
from
November 7, 2024 22:57
27dbd35
to
956f763
Compare
== Use a timeout always with lfs It seems pretty clear now that `lfs` invocation should always have a timeout to guard against Lustre locking-up all our workers. So, now use a 1-minute timeout by default in `run_lfs`. Then, handle both `lfs quota` and `lfs hsm_state` not returning successfully. In `StorageNode.update_avail_gb`, passing `None` now means don't update `avail.gb` (but do still update the last check time). If the current value of `avail_gb` is not null/None, a warning is issued. For `hsm_state` failing, various places in `LustreHSM` where it was used now handles not being able to determine the state. == Use hsm_action to track in-progress restores I was reading through the lustre source code last night to see if I could figure out what's up with `hsm_restore` timing out when files are in the process of being restored. I didn't figure that out because I discovered, instead, the `hsm_action` command which tells you what HSM is currently doing to a file (e.g. is it working on restoring it?). So, there's another `HSMState`: `RESTORING` for files which HSM is in the process of restoring, and alpenhorn will now use that to track progress during restores. This removes the need for `_restore_retry` (because alpenhorn no longer needs to guess as to whether a restore is happening or not). == Removing stats from LustreHSM The idea here is: using `stat()` to check for file existance, while avoiding making an external `lfs` call, causes trouble when /nearline is acting up because the `stat()` will get a worker stuck in IO-wait, while the `lfs` call can be abandonned (by subprocess timeout) meaning the workers don't get stuck. So, I've removed the stat from at the top of `lfs.hsm_state`. I originally had it there because I thought that a cheap `stat` would save us from an expensive `lfs` call. I've modified `lfs_run` to detect and report missing files instead. I've also re-implemented `LustreHSMNodeIO.exists` to use `lfs` instead of stat-ting the filesystem.
The nearline HSM on cedar has unstuck itself sufficiently that's I'm fairly confident this is now working as intended. |
ljgray
approved these changes
Nov 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All
lfs
calls need a timeoutIt seems pretty clear now that
lfs
invocation should always have a timeout to guard against Lustre locking-up all our workers. So, now use a 1-minute timeout by default inrun_lfs
.Then, handle both
lfs quota
andlfs hsm_state
not returning successfully. InStorageNode.update_avail_gb
, passingNone
now means don't updateavail.gb
(but do still update the last check time). If the current value ofavail_gb
is not null/None, a warning is issued.For
hsm_state
failing, various places inLustreHSM
where it was used now handles not being able to determine the state.Also removed an unnecessary
lfs quota
invocation from the idle updateLustreHSMNodeIO.release_files()
Using
hsm_action
to probe HSM restores in-progressI was reading through the lustre source code last night to see if I could figure out what's up with
hsm_restore
timing out when files are in the process of being restored.I didn't figure that out because I discovered, instead, the
hsm_action
command which tells you what HSM is currently doing to a file (e.g. is it working on restoring it?).So, there's another
HSMState
:RESTORING
for files which HSM is in the process of restoring, and alpenhorn will now use that to track progress during restores. This removes the need for_restore_retry
(because alpenhorn no longer needs to guess as to whether a restore is happening or not).Closes #198 (because those constants are no longer present).
Removing stats from LustreHSM
The idea here is: using
stat()
to check for file existance, while avoiding making an externallfs
call, causes trouble when/nearline
is acting up because thestat()
will get a worker stuck in IO-wait, while thelfs
call can be abandonned (by subprocess timeout) meaning the workers don't get stuck.So, I've removed the stat from at the top of
lfs.hsm_state
. I originally had it there because I thought that a cheapstat
would save us from an expensivelfs
call. I've modifiedlfs_run
to detect and report missing files instead.I've also re-implemented
LustreHSMNodeIO.exists
to uselfs
instead of stat-ting the filesystem.