-
Notifications
You must be signed in to change notification settings - Fork 106
Delete cluster name state file whenever slurm accounting is configured or updated #2994
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2994 +/- ##
========================================
Coverage 75.50% 75.50%
========================================
Files 23 23
Lines 2356 2356
========================================
Hits 1779 1779
Misses 577 577
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do we have an integ test capturing the same scenario when we execute the cluster update? |
@@ -88,6 +88,15 @@ | |||
retry_delay 10 | |||
end unless kitchen_test? || (node['cluster']['node_type'] == "ExternalSlurmDbd") | |||
|
|||
bash "Remove existing cluster name state file" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please cover this new logic with a spec test?
@@ -23,3 +23,12 @@ | |||
supports restart: false | |||
action %i(disable stop) | |||
end | |||
|
|||
bash "Remove existing cluster name state file" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please cover this new logic with a spec test?
code <<-CLUSTERSTATE | ||
rm /var/spool/slurm.state/clustername | ||
CLUSTERSTATE | ||
only_if { ::File.exist?('/var/spool/slurm.state/clustername') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using an only_if
rather than having a rm-f
?
code <<-CLUSTERSTATE | ||
rm /var/spool/slurm.state/clustername | ||
CLUSTERSTATE | ||
only_if { ::File.exist?('/var/spool/slurm.state/clustername') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change we are fixing a bug. Can we surface it in the changelog? |
@@ -23,3 +23,12 @@ | |||
supports restart: false | |||
action %i(disable stop) | |||
end | |||
|
|||
bash "Remove existing cluster name state file" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is duplicated. What about reducing code duplication by defining this logic into a function and call that function?
Description of changes
/var/spool/slurm.state/clustername
does not match the cluster id that slurm dbd hasclear_slurm_accounting
andconfig_slurm_accounting
config_slurm_accounting
and have the cluster id mismatchclear_slurm_accounting
and have the cluster id mismatchTests
test_slurm_accounting
andtest_slurm integ
tests./var/spool/slurm.state/clustername
, once I restart slurmctld, the slurm state remains the same.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.