Repository navigation
Lower severity for recomputing logs for quotas/roles/row policies/settings profiles - #108789
Conversation
Pre-PR validation gate (click to expand)
No regressions: the quota/role/policy/profile stateless suite ( Session id: cron:clickhouse-worker-slot-2:20260629-031300 |
|
cc @pufit @vitlibar — could you review this? It stops the access-cache recompute logs (QuotaCache/RoleCache/RowPolicyCache/SettingsProfilesCache, added in #107672) from being forwarded to the client that issued the access DDL: the recompute runs in the batch-finished callback on the client query thread, so with send_logs_level<=warning the line leaks to client stderr and made access DDL tests (e.g. 02884_authentication_quota) flaky on sanitizer builds. Fix detaches the thread client log queue around the batch-finished loop; the server log is unchanged. |
|
Workflow [PR], commit [1e8a936] Summary: ✅
AI ReviewSummaryThis PR lowers the four access-cache recomputation diagnostics from Final Verdict
|
|
Pushed Root cause was in the new regression test, not the C++ guard. The test created its row policy on the globally-shared Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260629-065000 |
|
@groeneai, this is not worth it. Instead, change the log level of these warning messages to debug, and the log level of the other related messages to trace. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260630-171000 |
|
Done in b22f7ad. Reverted the Reworked 04416 to assert the line is forwarded at |
CI finish ledger — 66f32b5Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
No PR-caused failures: this PR only lowers the #107672 access-cache recompute log levels (slow WARNING->DEBUG, fast DEBUG->TRACE) + a test; the 04416 per-test FAIL is the expected bugfix-validation signal (job-level PASS), and Post Hooks is a pre-existing CI-infra flake in the Post-Hooks family addressed by the merged PRs above. Session id: cron:our-pr-ci-monitor:20260701-003000 |
|
Pushed The earlier CI-finish ledger read this failure as an "expected bugfix-validation signal (job-level PASS)", but that was not what happened. The per-arch Root cause: the test only probed Fix: re-add the
New reference is |
|
Corrected the PR body (no code change) on two factual points, both verified against the tree:
No change to the C++ log-level fix or the test. |
| # The access-entity caches (QuotaCache, RoleCache, RowPolicyCache, SettingsProfilesCache) | ||
| # recompute every enabled set on each access change, in a batch-finished callback that runs on | ||
| # whichever client thread issued the DDL, and log the recompute size and duration. On the fixed | ||
| # server those lines are server-internal diagnostics emitted at TRACE (fast recompute) / DEBUG | ||
| # (slow, >= 1000 ms); on master (before this change) they are DEBUG (fast) / WARNING (slow), so a | ||
| # slow recompute leaks onto the issuing client's stderr at the default send_logs_level=warning | ||
| # (which clickhouse-test treats as a failure). Exercises all four caches at three client levels: | ||
| # trace -> forwarded (1) the recompute path actually runs and the lines exist | ||
| # debug -> a fast (< 1000 ms) recompute line NOT forwarded (0) the deterministic fix check | ||
| # warning -> not forwarded (0) the user-facing contract: the default level no longer leaks | ||
| # | ||
| # The debug probe is what makes this a valid regression test (it fails on master, passes on the | ||
| # fix), while staying free of the threshold flakiness that a naive debug assertion would have: | ||
| # * On master the fast path is LOG_DEBUG, so a debug client always receives those fast lines | ||
| # (duration < 1000 ms) -> the probe counts >= 1 and the test FAILS on master HEAD. | ||
| # * On the fixed server the fast path is LOG_TRACE (not forwarded to a debug client) and only | ||
| # the slow >= 1000 ms path is LOG_DEBUG. By counting only lines whose measured duration is | ||
| # < 1000 ms we ignore that slow path, so the probe is a deterministic 0 on the fix regardless | ||
| # of how slow a recompute gets under sanitizer/thread-fuzzer load. | ||
| # | ||
| # send_logs_level is connection-level (the recompute fires after the statement's per-query | ||
| # settings are gone), so build a client per level by replacing the runner-injected value | ||
| # (clickhouse-client rejects a repeated --send_logs_level). |
There was a problem hiding this comment.
Unlikely someone will read this, please keep only essentials in this comment and in the PR description, and rebase the changes (to leave only one commit)
There was a problem hiding this comment.
Done. Trimmed the test header comment and the PR description to essentials, and squashed the branch to a single commit (3b9295f). The C++ log-level change and the 04416 reference (1/0/0) are preserved byte-for-byte; the only change from the prior head is the shorter comment.
There was a problem hiding this comment.
Not good enough, look what I did, and do the same next time
Besides I don't think "Do not forward access cache recompute logs to the client" is a good title, the logs can be forwarded still just under different send_logs_level
There was a problem hiding this comment.
Thanks, kept your title ("Lower severity for recomputing logs ...") and the trimmed "Not for changelog" description. The verbose test comment is gone with the test.
0bdbcb7 to
3b9295f
Compare
| @@ -0,0 +1,93 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
I don't understand what this test is doing, please check that it make sense, this logs can appears only in case of high pressure of RBAC queries which I don't see here, if I am right, please just remove the test
There was a problem hiding this comment.
You are right. These lines only fire on high RBAC pressure (the slow >= 1000 ms recompute at WARNING was what leaked to a default client), and this sequence does not create that pressure. Removed the test; the PR is now the log-level change only, squashed to one commit. Also matches the "Not for changelog" recategorization, which drops the bugfix-validation regression-test requirement that had motivated it.
…tings profiles Follow up for ClickHouse#107672. The access-cache recompute log lines (QuotaCache, RoleCache, RowPolicyCache, SettingsProfilesCache) were forwarded to the client that issued an access DDL. Lower them so they are not sent at the default client log level: slow (>= 1000 ms) recompute LOG_WARNING -> LOG_DEBUG, fast (< 1000 ms) recompute LOG_DEBUG -> LOG_TRACE. Co-Authored-By: Claude Opus 4.8 <[email protected]>
3b9295f to
1e8a936
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 16/16 (100.00%) · Uncovered code |
…tas/roles/row policies/settings profiles
Backport #108789 to 26.6: Lower severity for recomputing logs for quotas/roles/row policies/settings profiles
…ecompute-log-client-leak Lower severity for recomputing logs for quotas/roles/row policies/settings profiles
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Lower severity for recomputing logs for quotas/roles/row policies/settings profiles (follow up for #107672)
CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108731&sha=c02e9daa17a958e1f892bd3a214e207b7dce3bef&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29
Version info
26.7.1.488(included in26.7and later)26.6.5.60