Skip to content

umbrella: qa/tasks/nvme_loop: fall back to sysfs-based discovery if needed - #72086

Merged
batrick merged 3 commits into
ceph:umbrellafrom
rkachach:wip-80839-umbrella
Oct 7, 2026
Merged

batrick merged 3 commits into
ceph:umbrellafrom
rkachach:wip-80839-umbrella

Conversation

@rkachach

Copy link
Copy Markdown
Contributor

@rkachach rkachach added this to the umbrella 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
@rkachach rkachach modified the milestones: umbrella, v21.1.2 Sep 30, 2026
@batrick

batrick commented Sep 30, 2026

Copy link
Copy Markdown
Member

@kginonredhat kginonredhat 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.

@batrick

batrick commented Sep 30, 2026

Copy link
Copy Markdown
Member

@batrick

batrick commented Oct 7, 2026

Copy link
Copy Markdown
Member

@kginonredhat please add yourself to .githubmap in the main branch.

@batrick
batrick merged commit 4aad8d7 into ceph:umbrella Oct 7, 2026
23 checks passed
@kginonredhat kginonredhat mentioned this pull request Oct 8, 2026
4 of 14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants