Repository navigation
common: add debug level guard to auto-revert high debug levels - #68442
Conversation
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
13 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
Config Diff Tool Output+ added: high_debug_level_reset_timeout (global.yaml.in)
+ added: high_debug_level_threshold (global.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
aae1d15 to
053237d
Compare
|
/config check ok |
053237d to
8e6058a
Compare
|
@ceph/core mind taking a look when you get a chance? Adds a debug level guard that auto-reverts a subsystem's debug level after a timeout, so an accidentally-bumped log level doesn't stay high forever. New common component with unit test + qa workunit. Rebased on current main, rebuilt clean (9/9 unit tests, ceph-mon/ceph-osd link fine); earlier red make check was a stale build env. |
|
@rzarzynski mind taking a look when you get a chance, or pointing me to the right person? (the @ceph/core mention above doesn't notify since I'm not in the org) |
| sleep 1 | ||
| waited=$((waited + 1)) | ||
| done | ||
| echo "Timed out waiting for $subsys on $daemon to revert below $threshold" |
There was a problem hiding this comment.
- echo "Timed out waiting for $subsys on $daemon to revert below $threshold"
+ echo "ERROR: Timed out waiting for $subsys on $daemon to revert below $threshold"Helps with debugging.
| sleep 1 | ||
| waited=$((waited + 1)) | ||
| done | ||
| echo "Timed out waiting for $code in ceph health detail" |
There was a problem hiding this comment.
Also add ERROR: here.
Applies to all other error messages.
There was a problem hiding this comment.
Done for all three failure messages (wait_for_revert, wait_for_health_warning, wait_for_health_clear). The remaining checks are bare test calls under bash -ex, so the trace already shows which comparison failed.
| * RADOS: Added a debug-level guard that protects against accidentally leaving | ||
| debug subsystems at high log levels in production. When `high_debug_level_threshold` | ||
| is set (default `0` = disabled), any subsystem whose log level sits at or above | ||
| the threshold for longer than `high_debug_level_reset_timeout` seconds (default | ||
| `300`) is automatically reverted to the last known safe value, and a | ||
| `HIGH_DEBUG_LEVEL` health warning surfaces in `ceph health detail` while the | ||
| level remains elevated. Setting `high_debug_level_reset_timeout` to `0` gives | ||
| warn-only mode (health warning without auto-revert). | ||
| Related Tracker: https://tracker.ceph.com/issues/75467 | ||
|
|
There was a problem hiding this comment.
I would consider also adding this to the Documentation.
There was a problem hiding this comment.
Added docs in two places:
doc/rados/troubleshooting/log-and-debug.rst: new "Guarding Against High Debug Levels" section withconfvalentries forhigh_debug_level_thresholdandhigh_debug_level_reset_timeout. Covers what it reverts to (last level below the threshold, compiled default if the daemon started high), that only the log level is checked, warn-only mode, and that the revert only changes the running value, so a level set withceph config setneeds aceph config rmor it comes back on restart.doc/rados/operations/health-checks.rst:HIGH_DEBUG_LEVELentry under Miscellaneous, linking back to that section.
ljflores
left a comment
There was a problem hiding this comment.
Looks good! After the nit comments are addressed, I think this is ready to go into QA.
|
jenkins test api |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
still active |
1fb9964 to
1e3b0d2
Compare
|
@ljflores addressed your three comments and squashed into the single commit ( |
|
Nice. What defines the last known safe level? Safety is relative. |
It's the last log/memory level the daemon had below high_debug_level_threshold, recorded on every tick (debug_level_guard.cc:42-44). If the daemon started already above the threshold, it's the compiled default (debug_level_guard.h:48-51). We should maybe even drop the word, how about we say long_desc: When a debug subsystem exceeds high_debug_level_threshold, the daemon sets it back to the level it had before it was raised, after this many seconds. ... |
I like that better. It says what the option does without promising more than we know. Is this stored in central config, or only runtime within the daemon? If the former we should be careful re cardinality or what happens if the new trim code removes a prior setting. |
When debug levels are accidentally set too high (e.g., debug_osd 20), they can cause catastrophic disk I/O floods and CPU overhead, leading to service outages. This adds a DebugLevelGuard that periodically checks subsystem debug levels and automatically reverts any that have been above a configurable threshold for longer than a timeout. New config options: - high_debug_level_threshold (default: 0, disabled): log level at or above which the guard activates. When exceeded, a HIGH_DEBUG_LEVEL health warning is issued. - high_debug_level_reset_timeout (default: 300s): seconds before an excessively high debug level is auto-reverted to its previous safe value. Set to 0 to disable auto-revert while keeping the health warning. The guard is called from existing daemon tick functions (OSD, Monitor, and Crimson OSD) with zero hot-path overhead. It only scans subsystem levels once per tick interval. When reverting, it restores the last known safe level rather than the compiled default, so intentional customizations (e.g., debug_osd 1/5) are preserved. Only the log level is checked, not the gather level. High gather levels are safe because those messages stay in memory for crash dumps and don't cause disk I/O. The feature is disabled by default (threshold=0) and must be explicitly enabled by setting high_debug_level_threshold to a non-zero value. Includes unit tests (9 GTest cases) and integration test for teuthology. Tracker: https://tracker.ceph.com/issues/75467 Signed-off-by: Lumir Sliva <[email protected]>
1e3b0d2 to
6dd4b1e
Compare
Runtime only. The revert is a local One side effect: if the high level came from Pushed the wording change to both option descriptions and the release note. |
|
This PR has been added to wip-bharath15-testing-20260929.043152-main. |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
|
Amazing! Thank you everyone. We probably want to backport this to tentacle/umbrella ? It makes sense to me. I briefly checked and there are only 2 small conflicts in tentacle. Squid is not worth anymore. Do you agree @ljflores @anthonyeleven or who decides in these cases? |
High debug levels (e.g.
debug_osd 20) set accidentally in production can cause catastrophic disk I/O floods and CPU overhead. This adds a guard that periodically checks subsystem debug levels and auto-reverts any that have been above a threshold for longer than a timeout.What it does
high_debug_level_threshold(default0= disabled) andhigh_debug_level_reset_timeout(default300s, set to0for warn-only mode).HIGH_DEBUG_LEVELmgr health warning surfaces inceph health detail.debug_osd 1/5are preserved.Example
Tests
test_debug_level_guard.cc: threshold disabled/active, warn-only, revert restores previous not default, manual-lower cancels revert, re-elevation resets timer, multiple subsystems tracked independently.qa/workunits/mon/debug_level_guard.sh+ teuthology suite entry underrados/singleton/all/, exercises a live cluster, verifies the health warning surfaces and clears.Tested on vstart
End-to-end verified on a local vstart cluster (MON=1, MGR=1, OSD=1 and MON=1, MGR=1, OSD=3):
debug_bluestorefrom1/5to25/25; health surfacedHIGH_DEBUG_LEVEL; auto-reverted to1/5after timeout; health cleared.reset_timeout=0the warning persisted and no revert fired, warn-only mode works.HIGH_DEBUG_LEVELmetric throughmgr.server handle_report daemon_health_metrics.The two new config options (
high_debug_level_threshold,high_debug_level_reset_timeout) are documented indoc/rados/troubleshooting/log-and-debug.rst, theHIGH_DEBUG_LEVELhealth check indoc/rados/operations/health-checks.rst, and both inPendingReleaseNotes.Tracker: https://tracker.ceph.com/issues/75467
Checklist