Skip to content

blk:Warning added for discard queue overflow - #61286

Merged
Jayaprakash-ibm merged 4 commits into
ceph:mainfrom
Jayaprakash-ibm:discard_queue_overutilized
Jul 3, 2025
Merged

Jayaprakash-ibm merged 4 commits into
ceph:mainfrom
Jayaprakash-ibm:discard_queue_overutilized

Conversation

@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

Added a health warning mechanism to monitor the discard queue for potential overload.

Emits a warning if the accumulated discarded bytes in the queue exceed the configured threshold.

Introduced a debugging tool to simulate slow discard operations by adding a configurable delay.

Tracker Ticket : 69082

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@ifed01

ifed01 commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

@Jayaprakash-ibm, please be aware of #61455 which could be relevant to the same issue.

@Jayaprakash-ibm
Jayaprakash-ibm marked this pull request as ready for review January 28, 2025 12:41
@Jayaprakash-ibm
Jayaprakash-ibm requested a review from a team as a code owner January 28, 2025 12:41
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Comment thread src/mon/PGMap.cc Resolved
Comment thread src/common/options/global.yaml.in Resolved
@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 7ee7c7d to 70e02be Compare February 27, 2025 12:29
Comment thread src/common/options/global.yaml.in Resolved
Comment thread src/blk/BlockDevice.cc Resolved
Comment thread src/common/options/global.yaml.in Resolved
Comment thread src/common/options/global.yaml.in Outdated

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.

I would think that a discard queue would be sized in terms of ops, not in bytes. Help me understand why bytes are used here please.

s/specified limit/specified value/

... as a large backlog can obstruct the allocation of drive capacity that is marked free but not yet available. This in turn can impact system performance and storage efficiency.

double backticks around bdev_async_discard_max_pending

But back to my first question, if the queue is items, why are we thresholding on bytes instead of on items? Does the size of an entry in bytes vary? Can we make it items instead?

@Jayaprakash-ibm Jayaprakash-ibm Mar 3, 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.

Hi @anthonyeleven, thanks for the suggestions.

The discard queue is an interval_set<uint64_t>, where unprocessed discard operations are tracked as byte ranges in memory.

The bdev_discard_queue_threshold parameter defines the maximum allowable size, in bytes, of these unprocessed discard operations.

When the total size of the pending discard ranges surpasses this threshold, a health warning is triggered

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.

I agree with @anthonyeleven that one should track (limit) discard queue in terms of entry count not bytes. E.g. IMO having a single huge extent in the discard queue is much less critical than having tons of small extents which total the same amount of bytes.

Please see #61455 which introduces the discard queue cap in terms of entry count.

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.

Hi @ifed01 I see your point about tracking discard queue by entry count rather than size.

A health warning has been added for both discard queue entry count and size, as I believe limiting by size is also important.

If too many bytes accumulate in the discard queue whether from a few large discard operations or many smaller ones the allocator's performance degrades, impacting allocation quality and eventually leading to free space exhaustion.

@aclamk aclamk added aclamk-testing-nauvoo bluestore testing and removed aclamk-testing-nauvoo bluestore testing labels Mar 4, 2025
Comment thread src/blk/BlockDevice.cc Outdated

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.

Now with discard queue cap introduced by #61455 shouldn't we instead raise the alert when this cap has been reached and some ops have being rejected.?The above could be coupled with some cooldown period after which the alert is removed if no discard ops have been lost.

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.

Any feedback on that?

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.

Hi @ifed01 Addressed the Change , raised a warn when cap has been reached

@ifed01

ifed01 commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

@Jayaprakash-ibm - mind adding perf counter(s) to monitor discard queue length in both entry count and bytes?

@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch 2 times, most recently from 02f0685 to fad0ea4 Compare March 6, 2025 21:34
@aclamk

aclamk commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@aclamk aclamk removed the aclamk-testing-nauvoo bluestore testing label Mar 25, 2025
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from fad0ea4 to 582e2a7 Compare April 4, 2025 11:41
Comment thread src/common/options/global.yaml.in Outdated

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.

size in bytes

@github-actions

github-actions Bot commented Jun 5, 2025 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: bdev_discard_max_bytes (global.yaml.in)
+ added: bdev_debug_discard_sleep (global.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 1b4e058 to 5eacc46 Compare June 6, 2025 09:21
@aclamk

aclamk commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@aclamk aclamk removed the aclamk-testing-phoebe bluestore testing label Jun 6, 2025
@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

2 similar comments
@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@ceph ceph deleted a comment from aclamk Jun 10, 2025
@ceph ceph deleted a comment from aclamk Jun 10, 2025
@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

2 similar comments
@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@aclamk

aclamk commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 5eacc46 to 3c19a90 Compare June 11, 2025 09:42
@aclamk

aclamk commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

1 similar comment
@aclamk

aclamk commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 3c19a90 to 156b8bb Compare June 25, 2025 07:08
Added a health warning mechanism to monitor the discard queue for potential overload
Emits a warning if the accumulated discarded bytes in the queue exceed the configured threshold
Introduced a debugging tool to simulate slow discard operations by adding a configurable delay

Fixes : https://tracker.ceph.com/issues/69082

Signed-off-by: Jaya Prakash <[email protected]>
…leep options

Added a health warning mechanism to monitor the discard queue for potential overload
Emits a warning if the accumulated discarded bytes in the queue exceed the configured threshold
Introduced a debugging tool to simulate slow discard operations by adding a configurable delay

Fixes : https://tracker.ceph.com/issues/69082

Signed-off-by: Jaya Prakash <[email protected]>
Added a health warning mechanism to monitor the discard queue for potential overload
Emits a warning if the accumulated discarded bytes in the queue exceed the configured threshold
Introduced a debugging tool to simulate slow discard operations by adding a configurable delay

Fixes : https://tracker.ceph.com/issues/69082

Signed-off-by: Jaya Prakash <[email protected]>
@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 156b8bb to 2e121b3 Compare July 3, 2025 07:18
@Jayaprakash-ibm
Jayaprakash-ibm force-pushed the discard_queue_overutilized branch from 7d6e4e6 to 29b9d11 Compare July 3, 2025 08:02
@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor Author

/config check ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants