Skip to content

DAOS-17935 control: Remove spdk lockfiles before and after local scan - #16769

Merged
daltonbohning merged 4 commits into
masterfrom
tanabarr/control-spdk-clean-on-scanfmt
Sep 9, 2025
Merged

daltonbohning merged 4 commits into
masterfrom
tanabarr/control-spdk-clean-on-scanfmt

Conversation

@tanabarr

@tanabarr tanabarr commented Aug 26, 2025 •

Copy link
Copy Markdown
Contributor

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Features: control

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@tanabarr
tanabarr requested review from a team as code owners August 26, 2025 20:46
@github-actions

Copy link
Copy Markdown

Ticket title is 'SPDK lockfiles need to be removed in storage format and scan'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-17935

@tanabarr tanabarr self-assigned this Aug 26, 2025
@tanabarr
tanabarr requested a review from ryon-jensen August 26, 2025 22:06
ryon-jensen
ryon-jensen previously approved these changes Aug 26, 2025

@ryon-jensen ryon-jensen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16769/1/testReport/

@tanabarr tanabarr added bug control-plane work on the management infrastructure of the DAOS Control Plane labels Aug 27, 2025
@tanabarr
tanabarr requested review from kccain, kjacque, knard38 and liw August 27, 2025 10:31
Comment thread src/control/server/ctl_storage_rpc.go Outdated
if err := cs.cleanSpdkResources(); err != nil {
return nil, errors.Wrap(err, "clean spdk resources")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NiuYawei, do you know if this is safe? I think for StorageFormat it's okay, but my knowledge is insufficient in the StorageScan case.

@tanabarr tanabarr Aug 29, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In response to the question:

Does the clean up call promise to keep data intact?

On format, lockfiles for engine should be removed before and after because the engine in question has not been started yet. On scan, lockfiles should be removed before and after if the relevant engine(s) have not started (this requires a change to the current PR, thanks for prompting). If during scan the engine has already started then lockfiles should not be touched as the scan goes through dRPC to the engine. The orphan-hugepage part of cleanup doesn't affect hugepages owned by an existing process. So if the above is considered the call should promise to keep data intact.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, sounds fine to me then.

liw
liw previously approved these changes Aug 29, 2025
Comment thread src/control/server/ctl_storage_rpc.go Outdated
if err := cs.cleanSpdkResources(); err != nil {
return nil, errors.Wrap(err, "clean spdk resources")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, sounds fine to me then.

@daosbuild3

Copy link
Copy Markdown
Collaborator

@tanabarr
tanabarr dismissed stale reviews from liw and ryon-jensen via e78b4b2 August 29, 2025 15:47
@tanabarr
tanabarr requested review from a team as code owners August 29, 2025 15:47
@tanabarr
tanabarr force-pushed the tanabarr/control-spdk-clean-on-scanfmt branch from e78b4b2 to b84dfe1 Compare August 30, 2025 14:25
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-16769/5/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-16769/6/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16769/7/testReport/

liw
liw previously approved these changes Sep 1, 2025
Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@tanabarr
tanabarr requested review from liw and ryon-jensen September 3, 2025 09:21
@tanabarr tanabarr changed the title DAOS-17935 control: Remove spdk lockfiles before scan or format DAOS-17935 control: Remove spdk lockfiles before and after local scan Sep 3, 2025
@tanabarr
tanabarr force-pushed the tanabarr/control-spdk-clean-on-scanfmt branch from 906a63d to 2f1716a Compare September 3, 2025 09:54
Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@tanabarr
tanabarr force-pushed the tanabarr/control-spdk-clean-on-scanfmt branch from 2f1716a to 74719e7 Compare September 3, 2025 11:00

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable to me. We have some unit tests related to cleaning up lockfiles, don't we? It would be good to verify this logic works as expected.

@tanabarr

tanabarr commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor Author

Looks reasonable to me. We have some unit tests related to cleaning up lockfiles, don't we? It would be good to verify this logic works as expected.

The clean methods are already unit tested. Adding these calls shouldn't necessitate new unit tests IMO but if you insist I will add them.

@tanabarr
tanabarr requested a review from kjacque September 4, 2025 18:25

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The main area that could benefit from a new test case is the conditional in spdkBackend.Scan. If you've verified this manually, though, I can approve it as-is. IMO any change in logic that produces some kind of verifiable behavior change is interesting to unit test, whenever that's possible anyway.

…dk-clean-on-scanfmt

Features: control
Allow-unstable-test: true
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@tanabarr

tanabarr commented Sep 6, 2025

Copy link
Copy Markdown
Contributor Author

@kjacque the unit tests weren't trivial, there is some problem in passing call stats from the MockNvmeImpl up to the scan call level that I have to figure out, I would like to land this and then figure that out as a subsequent change. The strange thing is that it works for the MockEnvImpl!

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16769/13/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16769/15/testReport/

@tanabarr

tanabarr commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor Author

Can I ask gatekeepers to consider force landing #16769 despite the config generate failures? I'm working on resolving those separately and I don't think they are introduced by PR-16769 and are a separate issue. PR-16769 will hopefully help with SRE-3150 and I think it's required for PR-16761 to work properly.

I've restarted the hardware large stage but I think I'm still going to get the config generate failures.

@daos-stack/daos-gatekeeper I hit rerun from stage hardware but please use results from run 15 when considering landing it.

@tanabarr
tanabarr requested a review from a team September 9, 2025 13:17
@tanabarr tanabarr added the forced-landing The PR has known failures or has intentionally reduced testing, but should still be landed. label Sep 9, 2025
@daltonbohning
daltonbohning merged commit 51e7d20 into master Sep 9, 2025
29 of 30 checks passed
@daltonbohning
daltonbohning deleted the tanabarr/control-spdk-clean-on-scanfmt branch September 9, 2025 13:54
tanabarr added a commit that referenced this pull request Nov 21, 2025
…#16769)

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
tanabarr added a commit that referenced this pull request Dec 2, 2025
…#16769)

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
daltonbohning pushed a commit that referenced this pull request Dec 4, 2025
…#16769) (#17160)

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
mchaarawi pushed a commit that referenced this pull request Mar 10, 2026
…#16769) (#17160)

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
phender added a commit that referenced this pull request Mar 12, 2026
* DAOS-18065 ci: empty /sys/class/nvme/ on leap15 when no NVMe device attached (#16956) (#17013)

On leap15 the /sys/class/nvme/ folder exists but it is empty
when no NVMe device attached.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>

* SRE-3562 ci: update MLNX_VER_NUM to 3.2.1 (#17463) (#17592)

Required for EL9.7

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>

* DAOS-17341 control: Remove spdk lockfiles on engine exit (#16181) (#16765)

PR-15799 introduced a change which means SIGKILL is used to terminate
engine processes during dmg system stop. One result of this is that
SPDK processes don't cleanup NVMe SSD lockfiles that are intended to
prevent multiple processes from accessing the same NVMe device.

This change enables the control plane to:
- Cleanup SPDK lockfiles and orphan hugepages on engine storage-ready,
termination and server start-up.
- Cleanup SPDK lockfiles and orphan hugepages on daos_server nvme
prepare|reset.
- Improve handling of disable_hugepages server config file parameter.
- Clean all SPDK lockfiles when daos_server nvme prepare|reset is
called without specifying any allow or block lists either via cli or
config file.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>

* DAOS-17935 control: Remove spdk lockfiles before and after local scan (#16769) (#17160)

Remove SPDK device lockfiles before and after ControlService performs
a scan on engine-assigned bdevs when an engine is not running. This
removes SPDK lockfiles for a device only when the engine has not
claimed that device.

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>

---------

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
Co-authored-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
Co-authored-by: Phil Henderson <phillip.henderson@hpe.com>
Co-authored-by: Tom Nabarro <tom.nabarro@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug control-plane work on the management infrastructure of the DAOS Control Plane forced-landing The PR has known failures or has intentionally reduced testing, but should still be landed.

Development

Successfully merging this pull request may close these issues.

6 participants