Skip to content

fix: report blobstore ENOSPC - #76

Merged
derekbit merged 21 commits into
longhorn:longhorn-v25.09from
c3y1huang:1061-v2-sharding-kbench-failure
Jul 27, 2026
Merged

fix: report blobstore ENOSPC#76
derekbit merged 21 commits into
longhorn:longhorn-v25.09from
c3y1huang:1061-v2-sharding-kbench-failure

Conversation

@c3y1huang

Copy link
Copy Markdown

Which issue(s) this PR fixes:

Issue longhorn/longhorn#1061

What this PR does / why we need it:

See RCA.

Special notes for your reviewer:

None

Additional documentation or context

None

@c3y1huang c3y1huang self-assigned this Jul 21, 2026
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch 2 times, most recently from 21509fa to d8356de Compare July 21, 2026 10:14
@c3y1huang
c3y1huang requested a review from Copilot July 21, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves how out-of-space conditions in the SPDK blobstore are surfaced and diagnosed, ensuring thin-provisioned write failures are reported as NVMe CAPACITY EXCEEDED (instead of a generic device error) and reducing log spam when the lvstore runs out of clusters. It also adds EC (erasure-coded bdev) diagnostics improvements to better attribute and throttle child I/O failure logging, aligned with the referenced RCA.

Changes:

  • Blobstore: add a one-shot “out of clusters” WARNLOG gate per full→free→full cycle.
  • Lvol: translate blobstore -ENOSPC into NVMe status GENERIC / CAPACITY_EXCEEDED.
  • EC bdev: add safe slot attribution via a published base-bdev pointer cache plus per-slot failure counters to throttle repeated failure logs; add unit test coverage for the new gate logic.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c Adds a unit test asserting ENOSPC maps to NVMe CAPACITY EXCEEDED and updates blob write stubs to inject errors.
test/unit/lib/bdev/ec/bdev_ec.c/bdev_ec_ut.c Adds a unit test for the per-slot failure log throttling gate behavior.
module/bdev/lvol/vbdev_lvol.c Maps blobstore -ENOSPC completion to spdk_bdev_io_complete_nvme_status(... CAPACITY_EXCEEDED).
module/bdev/ec/bdev_ec.c Publishes/clears cached base-bdev pointers on open/close paths; resets per-slot failure counter on successful hot-swap; adds more detailed submit-failure logs and exports failure counters in JSON.
module/bdev/ec/bdev_ec_io.c Adds slot mapping via cached base-bdev pointers and throttled logging on failed child I/O completion and submit failures.
module/bdev/ec/bdev_ec_internal.h Introduces base_bdevs[], child_io_failures[], and helper inlines for pointer publishing and log gating.
lib/blob/blobstore.h Adds out_of_clusters_warned to the blobstore state (protected by used_lock).
lib/blob/blobstore.c Implements the warn-once gate for ENOSPC cluster allocation and clears it when clusters are released.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/blob/blobstore.c
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch from d8356de to 1337c63 Compare July 21, 2026 10:30
@c3y1huang
c3y1huang requested a review from Copilot July 21, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread lib/blob/blobstore.c Outdated
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch from 1337c63 to 4238a68 Compare July 21, 2026 11:10
@c3y1huang
c3y1huang requested a review from Copilot July 21, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread module/bdev/ec/bdev_ec.c
Comment thread lib/blob/blobstore.c
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch from 4238a68 to 08c9c6c Compare July 21, 2026 11:42
@c3y1huang
c3y1huang requested a review from Copilot July 21, 2026 11:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread module/bdev/lvol/vbdev_lvol.c Outdated
Comment thread lib/lvol/lvol.c
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch from d935ccb to 8eaabbc Compare July 23, 2026 01:31
@c3y1huang
c3y1huang requested a review from Copilot July 23, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread lib/lvol/lvol.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread test/unit/lib/bdev/ec/bdev_ec.c/bdev_ec_ut.c
@c3y1huang
c3y1huang requested a review from Copilot July 23, 2026 01:59
@c3y1huang

c3y1huang commented Jul 23, 2026

Copy link
Copy Markdown
Author

While testing for benchmarking, found a bug: the module's optimal_io_boundary causes the bdev layer to split every write to one stripe before it arrives; this means the full-stripe condition will not be met. I will include the fix in this PR.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@c3y1huang
c3y1huang marked this pull request as ready for review July 24, 2026 04:05
c3y1huang added 21 commits July 27, 2026 08:43
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
@c3y1huang
c3y1huang force-pushed the 1061-v2-sharding-kbench-failure branch from 5ab116d to df37696 Compare July 27, 2026 00:44

@derekbit derekbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, LGTM

@derekbit
derekbit merged commit 324634b into longhorn:longhorn-v25.09 Jul 27, 2026
2 checks passed
@c3y1huang
c3y1huang deleted the 1061-v2-sharding-kbench-failure branch July 27, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants