Repository navigation
Lower the log level of the PK binary-search messages to Test - #110324
Conversation
The per-part binary-search messages emitted by `MergeTreeDataSelectExecutor` during primary key analysis (`Running binary search on index range for part ...`, `Found (LEFT) boundary mark: ...`, `Found (RIGHT) boundary mark: ...`) are very verbose: they are printed for every part and every boundary of every query that uses the binary search on the index. At the default `trace` level they flood the server log without being useful in the common case. Lower them from `Trace` to `Test` so they are only visible when explicitly enabled. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [8a1a190] Summary: ✅
AI ReviewSummaryThis PR lowers the per-part primary-key binary-search diagnostics in Final Verdict
|
The PK binary-search diagnostics in `MergeTreeDataSelectExecutor` were lowered from `Trace` to `Test`, so they are now only surfaced at the highest (`test`) verbosity. `test` is already an accepted value of the `LogsLevel` setting enum (`send_logs_level` is parsed via `magic_enum`), but it was missing from the documented list of valid values, both in the `send_logs_level` description and in the Native protocol spec. List `test` explicitly so the highest client log level is discoverable. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The gRPC `LogsLevel` enum stopped at `LOG_TRACE = 8`, but `GRPCServer` maps a log entry's Poco priority directly onto this enum via `set_level(static_cast<grpc::LogsLevel>(...))`. Any `test`-level message (`Poco::Message::PRIO_TEST == 9`) already produced an out-of-schema value, and lowering the PK binary-search diagnostics to `Test` adds more such messages when a gRPC client requests `send_logs_level='test'`. Declare `LOG_TEST = 9` so the published schema matches what the server emits, and add a matching `static_assert` next to the existing ones. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The sparse primary indexes guide instructs readers to enable trace logging to observe the `Running binary search on index range`, `Found (LEFT) boundary mark`, and `Found (RIGHT) boundary mark` messages. These were lowered to the `test` level, so add a note explaining how to raise the verbosity to `test` to see them, while leaving the rest of the version-pinned example (which is still logged at `trace`) intact. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`docs/reference/settings/session-settings.mdx` mirrors the `send_logs_level` docstring, so add `test` to its valid-values list to keep the generated documentation consistent with `src/Core/Settings.cpp`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…examples in the guide The AI review noted that only the first PK binary-search example mentioned that the `Running binary search on index range` and `Found (LEFT)/(RIGHT) boundary mark` messages are now logged at the `test` level. Make the note global and reference it from the secondary-table, materialized-view, and projection examples that show the same messages.
|
The two CI failures on commit 31b2f1c are unrelated to this PR (a log-level and documentation change):
Merged |
Address review: utils/grpc-client/pb2/clickhouse_grpc_pb2.py and clickhouse_grpc_pb2_grpc.py were generated before `LOG_TEST` was added to clickhouse_grpc.proto, so the bundled Python gRPC client could not reference clickhouse_grpc_pb2.LOG_TEST. Reran utils/grpc-client/generate_pb2.py as its own comment instructs after any change to the .proto file.
…rotocol spec docs/en/interfaces/specs/NativeProtocol.md and docs/reference/settings/session-settings.mdx already listed `test` as a valid `send_logs_level` value, but the Mintlify copy of the Native protocol spec at docs/reference/interfaces/specs/NativeProtocol.mdx still stopped at `trace`, leaving that doc surface stale.
…rsion The previous regeneration used `grpcio-tools` 7.35.0, whose generated code imports `google.protobuf.runtime_version`, a module only present in `protobuf` 5.26+. The stateless-test Docker image pins `protobuf==4.25.8` (`ci/docker/stateless-test/requirements.txt`), so `03203_grpc_protocol` failed with `ImportError: cannot import name 'runtime_version' from 'google.protobuf'`. Regenerated `clickhouse_grpc_pb2.py`/`clickhouse_grpc_pb2_grpc.py` using `grpcio-tools==1.62.3`, which matches the `protobuf` 4.25.x generation format the previously checked-in files used, and verified the import against the exact `protobuf==4.25.8`/`grpcio==1.66.2` versions pinned for CI.
…lumn description The `level` column of `system.text_log` already exposes `Test = 9` in its `Enum8` type, but the column description (and the docs generated from it) stopped at `8 or 'Trace'`. Append `9 or 'Test'` to the description in `TextLog.cpp` and to the autogenerated sections of the `text_log` docs.
…-logs.mdx`
The settings docs were split into per-group pages on master ("Flatten
generated settings groups"), regenerating them from master's
`src/Core/Settings.cpp` — which dropped the `test` value this PR adds
to the `send_logs_level` docstring. Sync the generated page with the
updated source docstring.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
CI status on
@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110324&sha=adae312dac3ede20f1516467db059154d56ae46a&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
This is the known regression from #100992 (that PR added Already tracked and fixed: issue #111053 and PR #111055 ("Detach tables permanently in part-loading-tree rollback tests", merged 2026-07-23, Closes #111053), which switches all four rollback tests including 04241 to |
|
Merged |
|
CI status for d2f8f55: the previous
|
|
Merged `master` again (clean) to pull in the fixes for the two unrelated CI failures from the previous run:
Rebuilt the four affected translation units locally (clean). Fresh CI is running on `a7ce0b00370`. |
|
CI on
Nothing to change here; both reds clear once those fixes merge. Also replied to the docs-translation review nit: |
|
Merged Since the previous run, the fix for the The other red, The PR's own diff is unchanged (12 files, logging level + docs/gRPC surfaces); the four affected translation units rebuild cleanly. |
|
CI on |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 30/30 (100.00%) · Uncovered code |
The per-part binary-search messages emitted by
MergeTreeDataSelectExecutorduring primary key analysis are very verbose. They are printed for every part and every boundary of every query that uses the binary search on the primary key index:Running binary search on index range for part ... (... marks)Found (LEFT) boundary mark: ...Found (RIGHT) boundary mark: ...At the default
tracelevel they flood the server log while rarely being useful in day-to-day operation. This lowers them fromTracetoTest, so they are only emitted when logging is explicitly turned up.Because
testis the highest verbosity level, this change also aligns the surfaces that expose log levels to clients so the messages remain discoverable:testis now listed among the valid values of thesend_logs_levelsetting and in the Native protocol spec (docs/en/interfaces/specs/NativeProtocol.md).LogsLevelschema gainsLOG_TEST = 9to match what the server already emits fortest-level entries.test-level logging.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reduced the verbosity of the per-part primary-key binary-search diagnostics in
MergeTreeby lowering them from trace logging to test logging.Documentation entry for user-facing changes
Version info
26.8.1.639(included in26.8and later)