Repository navigation
CI log parser: recognize AST Fuzzer oracle mismatch and any <Fatal> - #118056
Merged
Merged
Conversation
The AST Fuzzer oracle runs inside regular functional tests and, on a mismatch, the server logs a `<Fatal> ASTFuzzer: AST Fuzzer oracle mismatch detected!` message (`executeQuery`). `FuzzerLogParser` had no pattern for this message, so `parse_failure` fell through to "Unknown error" and the report showed a bare "Fatal error: this job has unknown error" even though the real reason (and reproducer query) was right there in the server log. - Add an `AST Fuzzer oracle mismatch` pattern, checked first, that folds the oracle kind (e.g. `TLP Aggregate`) into the failure name so distinct oracles group separately in CI DB, keeping the fuzzed query in the info. - Add a generic `<Fatal>` fallback: when no specific pattern matches, surface the first `<Fatal>` message (with its context, `<Fatal> ` prefix stripped) instead of "Unknown error"; only fall back to "Unknown error" when there is no `<Fatal>` at all. This makes future unclassified fatals visible too. - Add `ci/tests/test_log_parser.py` covering the oracle mismatch (with and without a recognizable oracle kind), the generic fatal fallback, the no-fatal "Unknown error" case, and specific-pattern precedence. Verified against the real server log from the CI report below: the parser now reports `AST Fuzzer oracle mismatch: TLP Aggregate` with the reproducer. CI report: http://ci-reports:8080/clickhouse-test-reports-private/praktika.html?PR=72199&sha=44cd74859f170577c193462e13b06f8743eba2a0&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20distributed%20cache%2C%20meta%20in%20keeper%2C%20s3%20storage%2C%20sequential%29 Related: #72199 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [df4a62a] Summary: ✅ AI ReviewSummaryThis PR teaches Findings❌ Blockers
Tests
Final VerdictRequest changes: the generic |
Address review on PR #118056: the oracle-kind capture used `[\w ]`, so it missed the `Identity WHERE ({}) oracle mismatch!` messages from `QueryOracleChecker` (e.g. `Identity WHERE (p AND 1) oracle mismatch!`), which then collapsed into the generic `AST Fuzzer oracle mismatch` bucket instead of grouping separately in CI DB. - Widen the capture to `[\w ()]` so parenthesized-but-fixed kind labels (`Identity WHERE (p AND 1)`, `Identity WHERE (NOT(NOT p))`) are kept, while DQP's variable `Setting: <name>` trailer (after the `!`) stays excluded. - Add a parametrized regression test covering every oracle-kind message emitted by `QueryOracleChecker`. Related: #118056 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address review on PR #118056: `parse_failure` stops at the first matching pattern class, so putting the oracle pattern before the sanitizer entry let a server-side oracle mismatch suppress a higher-signal ASan/TSan report in `stderr.log` when both were present. - Move the oracle pattern to right after `Sanitizer` so a sanitizer report (memory safety, highest signal) wins. Kept ahead of the generic server-log patterns so an unrelated `Logical error` from another test in the same run's aggregated server log does not steal the oracle classification. - Add a regression test with both logs populated, asserting the sanitizer failure is reported. Related: #118056 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address review on PR #118056: `stress_job.py` scans the log pair of each replica and treats the first `name != UNKNOWN_ERROR` as definitive, breaking the loop. The generic `<Fatal>` fallback turned an unclassified fatal into a non-`UNKNOWN_ERROR` name, so a transient generic fatal on one replica could preempt a higher-signal sanitizer/known failure on another replica that the loop would previously have reached (the generic fatal used to parse as `UNKNOWN_ERROR`). - `FuzzerLogParser` now exposes `is_generic_fatal`, set only when the result came from the generic `<Fatal>` fallback rather than a specific pattern. - `stress_job.py` uses three priority tiers across replicas: a specific classification wins outright and stops the scan; a generic fatal is preferred over "Unknown error" but does not preempt a specific failure on another replica (scan continues); "Unknown error" is the last resort. - Tests assert the flag is set only for the generic fallback (not for specific classifications or "Unknown error"). Related: #118056 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address review on PR #118056: the previous three-tier selection still broke the replica scan on the first specific classification, so a main-replica oracle mismatch could suppress a later replica's sanitizer report (before this PR the main replica parsed as `Unknown error`, so the scan reached the ASan report). - Extract the selection into `select_replica_failures`, which scans every replica's (server, stderr) log pair without breaking early. It collects all specific classifications and returns every distinct one (deduplicated by name, since replicated setups surface the same failure on several replicas). A generic `<Fatal>` and "Unknown error" are used only when no replica yielded a specific classification. - Add `ci/tests/test_stress_job.py` with regressions spanning two replica log pairs: a specific failure on the second replica is not hidden by the first; a generic fatal does not suppress a sanitizer on another replica; the same specific failure across replicas is reported once; generic fatal / unknown fallbacks are used only when nothing specific was found. Related: #118056 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address review on PR #118056: `get_generic_fatal` matched a `<Fatal>` substring anywhere on a line, so an ordinary <Debug>/<Error> log line quoting `<Fatal>` inside query text or a comment (e.g. `executeQuery: SELECT '<Fatal> not an error'`) was turned into a bogus failure name with `is_generic_fatal` set - even though no fatal record existed. - Anchor the generic-fatal search to the structured log prefix `[ <thread> ] {<query_id>} <Fatal>` (the same log-level heuristic the rest of the parser uses), so a quoted `<Fatal>` in query text is not matched. - Add a regression asserting a quoted `<Fatal>` in query text yields "Unknown error" and does not set `is_generic_fatal`. Related: #118056 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
maxknv
enabled auto-merge
September 9, 2026 13:53
huldarchen
pushed a commit
to huldarchen/ClickHouse
that referenced
this pull request
Sep 10, 2026
`QueryOracleChecker` compares a query's result against a metamorphic rewrite
of it for exact row equality, so it keeps a backstop set of aggregates whose
`State`/`Merge` path legitimately diverges from direct evaluation. `topK` and
`topKWeighted` were in that set; their space-saving counterparts
`approx_top_k` and `approx_top_sum` were not, even though `QueryFuzzer`'s
aggregate swap list offers `approx_top_k` for any single-argument aggregate.
Every oracle mismatch recorded on master over the last three weeks is that
substitution - four of them, all false:
Fuzzed query: SELECT g, count(), approx_top_k(v), max(v)
FROM oracle_tlp_agg WHERE v > 50 GROUP BY g ORDER BY g ASC
TLP Aggregate oracle mismatch!
Which elements survive the bounded counter table, and the counts reported for
them, depend on the order the values arrive in and on how the partial states
merge, so the three-way `WHERE` partition the TLP Aggregate oracle builds is
entitled to disagree with the whole-table reference.
The failure surfaced twice over: as the failing test, and again as a
blocker named `Unknown error` whose description reads "Lost connection to
server. See the logs." Nothing had crashed and no connection was lost -
`clickhouse_proc.py` treats any `<Fatal>` line in the server log as a
failure to classify, the oracle reports a mismatch with `LOG_FATAL`, and
`FuzzerLogParser.ERROR_PATTERNS` has no pattern for it, so it fell through to
`UNKNOWN_ERROR`. ClickHouse#118056 fixes
that reporting side; this change removes the mismatch itself.
Aliases are now resolved through `AggregateFunctionFactory` instead of being
enumerated. ClickHouse aliases plenty of aggregates the set already rejects -
`min_by`/`max_by` for `argMin`/`argMax`, `array_agg` for `groupArray`, `lttb`
for `largestTriangleThreeBuckets`, every `median*` for the matching
`quantile*`, `STDDEV_POP`/`VAR_SAMP`/`COVAR_POP` for the `stddev*`/`var*`/
`covar*` families - and each unlisted spelling is another false mismatch
waiting to red master. The expansion is stripped of combinators in turn, so
`array_concat_agg` reaches `groupArray` through `groupArrayArray`, and the
raw spelling is still tested first so the set stays free to name a function
by whichever spelling reads best.
The remaining additions are the aggregates `QueryFuzzer` can substitute in
that fall in classes the set already rejects: `sumCount` and the `sumMap*`
family (non-associative floating-point addition, like `sum`),
`corrMatrix`/`covarPopMatrix`/`covarSampMatrix` (like `corr`),
`analysisOfVariance` and `studentTTestOneSample` (like `studentTTest`),
`quantileExactWeightedInterpolated` and `quantilePrometheusHistogram` with
their plural forms, `groupArrayIntersect` (hash-table iteration order, like
`groupUniqArray`), `mergedJSONPatch` (last write per path wins, by sort key)
and `boundingRatio` (on ties in the x argument the first point seen wins).
`min`, `max`, `count`, `uniq`, `uniqExact` and the `groupBitmap*` family stay
checkable, so oracle coverage of the interesting cases is untouched.
Reports:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=6c335833c268d3c52d83b47abf4c2f807251e716&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20sequential%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=6c335833c268d3c52d83b47abf4c2f807251e716&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20distributed%20plan%2C%20s3%20storage%2C%20sequential%29
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Sep 14, 2026
…-info-head-window `ci/tests/test_stress_job.py` was the only conflict, and it is a modify/modify against a file that was deleted and then restored at a different shape: ClickHouse#115650 removed it, `bc83cbe9312d2` ("Restore live CI regression coverage") brought it back covering `select_replica_failures` instead, and ClickHouse#118056 has been maintaining it since. The 249-line file this branch added its tests to no longer exists in any form on master. Resolved by taking master's 124-line file verbatim - all five `select_replica_failures` tests are kept byte-for-byte - and re-applying this branch's six hung-check tests on top, with the imports merged and the module docstring extended to name both subjects. The `pytest` import and the `__main__` block this branch relied on are dropped rather than restored, because master's copy does not have them. `ci/jobs/scripts/stress/stress.py` and `tests/clickhouse-test` merged without conflict; both were verified by hand afterwards, since the target block in `stress.py` had moved about 190 lines (the hung-check call site is now at :1254) and `tests/clickhouse-test` had drifted far enough that a clean auto-merge is not by itself evidence the two added lines still landed inside the polling loop they are meant to pace. They did, and the loop shape the AST test pins is unchanged: one `while` containing `get_processlist_size`, with the zero-hung `break` before the added `sleep(1)`.
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AST Fuzzer oracle runs inside regular functional tests. On a mismatch the server logs a
<Fatal> ASTFuzzer: AST Fuzzer oracle mismatch detected!message (inexecuteQuery), butFuzzerLogParser(ci/jobs/scripts/log_parser.py) had no pattern for it. Soparse_failurefell through to "Unknown error" and the report showed a bare "Fatal error: this job has unknown error" even though the real reason and the reproducer query were right there in the server log.This change:
AST Fuzzer oracle mismatchpattern, checked first, folding the oracle kind (e.g.TLP Aggregate) into the failure name so distinct oracles group separately in CI DB, keeping the fuzzed query in the info.<Fatal>fallback: when no specific pattern matches, surface the first<Fatal>message (its context, with the<Fatal>prefix stripped) instead of "Unknown error"; only fall back to "Unknown error" when there is no<Fatal>at all. This makes future unclassified fatals visible too.ci/tests/test_log_parser.pycovering the oracle mismatch (with and without a recognizable oracle kind), the generic fatal fallback, the no-fatal "Unknown error" case, and specific-pattern precedence.Verified against the real
clickhouse-server.err.logfrom the CI report below: the parser now reportsAST Fuzzer oracle mismatch: TLP Aggregatewith the reproducer, instead of "Unknown error".Related: #72199
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/118056]
Version info
26.9.1.1113(included in26.9and later)