Skip to content

tentacle: qa/tasks/nvme_loop: fall back to sysfs-based discovery if needed - #72085

Closed
rkachach wants to merge 3 commits into
ceph:tentaclefrom
rkachach:wip-80840-tentacle
Closed

rkachach wants to merge 3 commits into
ceph:tentaclefrom
rkachach:wip-80840-tentacle

Conversation

@rkachach

Copy link
Copy Markdown
Contributor

@rkachach rkachach added this to the tentacle milestone Sep 25, 2026
@rkachach rkachach added the tests label Sep 25, 2026
nvme list -o json segfaults deterministically on kernel 6.8.0-*
nodes (ubuntu_22.04/24.04), exhausting all 15 safe_while
retries (ceph#69232 lets it retry, but every retry hits the same crash)
and failing smoke-roleless nvme_loop jobs.

This adds a fallback: after 5 consecutive CommandCrashedErrors, skip
nvme list -o json and discover devices via sysfs instead. Each loop
subsystem is connected using the device's basename as its NQN, which
the kernel exposes at /sys/class/nvme/nvmeX/subsysnqn; we match that
against /sys/class/nvme/nvmeX/nvmeXnY to recover the device path, with
no nvme-cli JSON parsing involved.

The existing JSON path is unchanged for nodes where it works normally
— json_failures resets on any success, so the fallback only triggers
on sustained crashes.

https://tracker.ceph.com/issues/77106
Assisted-by: ChatGPT <chatgpt.com>
Signed-off-by: Redouane Kachach <[email protected]>
(cherry picked from commit 01d8ea8)
`nvme_loop.py` falls back to sysfs-based device discovery when `nvme
list -o json` repeatedly crashes.

The existing fallback walks controller-specific paths such as:

```text
/sys/class/nvme/nvmeX/nvmeXnY
```

This is not reliable with native NVMe multipath, where the
user-visible namespace-head device may be exposed separately under
`/sys/class/block` and use a different naming relationship from the
controller path.

As a result, the fallback can return no devices even though the newly
connected NVMe loop devices are already visible through `lsblk`,
eventually causing the task to fail with `MaxWhileTries`.

This change:

* records the existing NVMe namespace devices before creating the loop connections;
* discovers visible namespace-head devices from `/sys/class/block`;
* identifies the new loop devices using the before/after difference;
* excludes partitions and controller-path devices.

The normal `nvme list -o json` path remains unchanged. Only the
fallback discovery path is modified.

https://tracker.ceph.com/issues/77106
Assisted-by: ChatGPT <chatgpt.com>
Signed-off-by: Redouane Kachach <[email protected]>
(cherry picked from commit b51649d)
Restrict sysfs fallback discovery to NVMe namespace heads whose
subsystem NQN matches one of the scratch-device basenames.

This preserves native multipath-compatible discovery while preventing
unrelated NVMe namespaces that appear during setup from being selected
and potentially passed to bluestore_zap().

https://tracker.ceph.com/issues/77106
Assisted-by: ChatGPT <chatgpt.com>
Signed-off-by: Redouane Kachach <[email protected]>
(cherry picked from commit c96a0e1)
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Sep 25, 2026
@guits

guits commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

jenkins test docs

@guits

guits commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@batrick do we need a qa tracker ticket for this?

@yuriw

yuriw commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri5-testing-20261005.150507-tentacle.

@batrick

batrick commented Oct 7, 2026

Copy link
Copy Markdown
Member

Moving this to #72064 due to merge conflicts.

@batrick batrick closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa releng-audit-pass Release engineering: passed backport verification audit. tests wip-pdonnell-testing2 wip-yuri5-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants