Project

General

Profile

Actions

Bug #83042

closed
YS

bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys)

Bug #83042: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys)

Added by yulong shi 22 days ago. Updated 8 days ago.

Status:
Backporting
Priority:
Normal
Assignee:
-
Target version:
-
Due date:
% Done:

0%

Source:
Community (dev)
Backport:
tentacle, squid, reef
Regression:
No
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v22.0.0-1454-gfef2043f9a
Released In:
Upkeep Timestamp:
2026-11-24T14:43:34+00:00

Description

Summary

bluestore_throttle_trace_rate cannot be changed at runtime. BlueStore::handle_conf_change() handles it and applies it through BlueStoreThrottle::reset_throttle(), but the option is missing from BlueStore::get_tracked_keys(). So the config observer never calls BlueStore when the option changes. ceph config set and ceph daemon osd.N config set both succeed, and config get / config show report the new value, but the OSD keeps sampling at the rate it read at startup until it is restarted.

The handler and the option were added together in 4d272b98c5 ("bluestore: revamp tracepoints, add sampling", PR #29674), without the tracked key. So every release since Octopus is affected, and main still is.

1. Reproduction on main

Build: main at 804b0e9a329 (BlueStore.cc is identical to main at 7f06b19a9c6), RelWithDebInfo, gcc 14. Cluster: vstart with 1 mon, 1 mgr and 1 BlueStore OSD. I added a perf uprobe on BlueStore::handle_conf_change() of the running ceph-osd and counted its calls while one option was changed, through the mon (ceph config set osd.0 ...) or through the admin socket (ceph daemon osd.0 config set ...):

                                            handle_conf_change calls   config get
mon   bluestore_throttle_bytes      -> 67108864          1              67108864
asok  bluestore_throttle_bytes      -> 67108865          1              67108865
mon   bluestore_throttle_trace_rate -> 0.002             0              0.002000
asok  bluestore_throttle_trace_rate -> 0.001             0              0.001000
asok  bluestore_throttle_trace_rate -> 0                 0              0.000000

bluestore_throttle_bytes is a tracked key and is handled in the same if as bluestore_throttle_trace_rate:

  if (changed.count("bluestore_throttle_bytes") ||
      changed.count("bluestore_throttle_deferred_bytes") ||
      changed.count("bluestore_throttle_trace_rate")) {
    throttle.reset_throttle(conf);
  }

A change of bluestore_throttle_bytes reaches it. A change of bluestore_throttle_trace_rate never does.

2. Effect

The rate decides which transactions BlueStoreThrottle::should_trace() samples for the bluestore:transaction_* tracepoints. 0, the default, samples every transaction. For each sampled transaction, emit_initial_tracepoint() also reads eight RocksDB properties, and each read takes the DB mutex.

  • On main, since PR #72807, none of this runs unless an LTTng session has the BlueStore tracepoints enabled. Someone tracing a busy OSD cannot lower the sampling rate without restarting it, and the restart loses the state they are looking at.
  • On released versions, which do not have #72807 (up to v20.2.x), it runs for every transaction of every OSD built with WITH_LTTNG=ON, even with no tracing session. Raising the rate at runtime is the obvious way to reduce that cost, and it silently does nothing.

Measured on a Pacific-based build (v16.2.14 with local patches that do not touch BlueStore; 4 SSD OSDs, 4 KiB rados bench writes, 64 in flight). The number is the share of BlueStoreThrottle::emit_initial_tracepoint in an on-CPU profile of osd.0:

unmodified, bluestore_throttle_trace_rate = 0.001 at startup        0.07%
unmodified, 0 at startup                                            2.37%
unmodified, 0 at startup, set to 0.001 at runtime                   1.00%   (config get: 0.001000)
with the fix below, 0 at startup                                    1.90%
with the fix below, set to 0.001 at runtime                         0.01%
with the fix below, set back to 0 at runtime                        2.68%

The share with rate 0 varies between runs (1-3.4% in repeated runs of the same build). The point is that a runtime change to 0.001 brings it down to the startup-0.001 level only with the fix.

3. Proposed fix

Add the option to the tracked keys:

--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ std::vector<std::string> BlueStore::get_tracked_keys() const noexcept
     "bluestore_throttle_bytes"s,
     "bluestore_throttle_deferred_bytes"s,
+    "bluestore_throttle_trace_rate"s,
     "bluestore_throttle_cost_per_io_hdd"s,

reset_throttle() already reads the option. The other two options it applies, bluestore_throttle_bytes and bluestore_throttle_deferred_bytes, are already tracked, so nothing else changes. With the fix, the same reproduction on main shows one handle_conf_change() call for each change of bluestore_throttle_trace_rate (through the mon and through the admin socket).

4. Related

  • PR #29674 / 4d272b98c5: added bluestore_throttle_trace_rate and its handler
  • PR #72807: do not sample transactions when tracing is off (main only so far)
  • PR #73710 / #82909: another BlueStore option that is not applied at runtime (cache age bins), a different set of keys

Related issues 3 (3 open — 0 closed)

Copied to bluestore - Backport #83512: tentacle: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys)New

Actions
Copied to bluestore - Backport #83513: reef: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys)New

Actions
Copied to bluestore - Backport #83514: squid: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys)New

Actions

YS Updated by yulong shi 22 days ago Actions #1

  • Pull request ID set to 73765

UB Updated by Upkeep Bot 8 days ago Actions #2

  • Copied to Backport #83512: tentacle: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys) added

UB Updated by Upkeep Bot 8 days ago Actions #3

  • Copied to Backport #83513: reef: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys) added

UB Updated by Upkeep Bot 8 days ago Actions #4

  • Copied to Backport #83514: squid: bluestore_throttle_trace_rate is not applied at runtime (missing from get_tracked_keys) added

UB Updated by Upkeep Bot 8 days ago Actions #5

  • Status changed from New to Backporting
  • Merge Commit set to fef2043f9af86b7629e812255d40bbb19b5e51a3
  • Fixed In set to v22.0.0-1454-gfef2043f9a
  • Upkeep Timestamp set to 2026-11-24T14:43:34+00:00
Actions

Also available in: PDF Atom