fix startup_console_log_level removal - #109858
Conversation
|
Workflow [PR], commit [9fb6857] Summary: ✅
AI ReviewSummaryThis PR fixes the startup restore path for PR Metadata
Findings
Final VerdictChanges requested. The runtime fix looks right, but the regression test should exercise a real console channel before this is merged, and the PR metadata should be updated to use the |
89f783f to
d38ea40
Compare
d38ea40 to
dbf5f7b
Compare
| # The console log level is raised at startup and then restored afterwards. | ||
| # When console_log_level is unset it reverts to follow logger.level ... | ||
| assert instance_console_unset.contains_in_log( | ||
| "Starting console logger in level trace" | ||
| ) | ||
| assert instance_console_unset.contains_in_log( | ||
| "Restored console logger level to logger.level" | ||
| ) | ||
| # ... and when it is explicitly configured it is restored to that value. | ||
| assert instance_console_set.contains_in_log( | ||
| "Starting console logger in level trace" | ||
| ) | ||
| assert instance_console_set.contains_in_log( | ||
| "Restored console logger level to warning" |
There was a problem hiding this comment.
These nodes are stay_alive=True, so the integration harness launches them via --daemon (tests/integration/helpers/cluster.py:4942-4950, tests/integration/helpers/cluster.py:6376-6377). Since neither new config sets logger.console, Loggers::updateLevels takes the split->setLevel("Console", 0) branch in that mode (src/Loggers/Loggers.cpp:355-366).
That means the assertions here only prove that Server.cpp wrote the expected message into clickhouse-server.log; they do not exercise the actual console channel or the user-visible misbehavior from #103472. Please enable logger.console in these cases and assert on stderr.log / container logs (or another console-only observable) so the regression test proves that console verbosity really drops back after startup.
There was a problem hiding this comment.
I think we might need to enable <console>true</console> in the logging configs.
There was a problem hiding this comment.
I think a slightly better test would be to enable the console and then assert on the stderr.log like the bot suggests. But I think that's unnecessary since the test already catches the regression correctly. I think we can add this test later if needed.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 10/13 (76.92%) · Uncovered code |
|
Also absolutely no flaky tests - all tests are green! |
681a0f1
Backport #109858 to 26.6: fix startup_console_log_level removal
Backport #109858 to 26.5: fix startup_console_log_level removal
Backport #109858 to 26.4: fix startup_console_log_level removal
Backport #109858 to 26.3: fix startup_console_log_level removal
Closes: #103472 (auto-closes the issue when this PR is merged into the default branch)
Related: #95919
Fixed
logger.startup_console_log_levelnot being reverted after startup: the console log level was captured from the wrong config key, so the console stayed at the elevated startup level for the lifetime of the server. Introduced in #95919. Fixes #103472.Fix
Capture the actual logger.console_log_level before overriding it.
On restore, since an unset console_log_level dynamically follows logger.level (see Loggers::updateLevels):
if console_log_level was explicitly configured, restore that value;
if it was unset, remove the temporary startup override so it falls back to logger.level again (this also avoids restoring an empty string, which would break parseLevel).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Version info
26.7.1.743(included in26.7and later)26.6.2.63,26.5.6.35,26.4.5.124,26.3.17.40