| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
ExecutableFunctionDynamicAdaptor::executeImpl reconciles a nested function's actual result type with the type it declares for Dynamic arguments by calling castColumn. Three of those calls wrapped every DB::Exception the cast could raise into LOGICAL_ERROR without inspecting e.code(), so a resource or cancellation error raised inside the cast was reported as an internal invariant violation: on a debug or sanitizer build the Exception constructor then reaches abortOnFailedAssertion and kills the server, and on a release build the user gets code 49 for what is actually code 241, which also buries the OOM signal. Observed on master in Stress test (arm_asan_ubsan) for commit a1cfa11, where a stress-injected memory-tracker fault surfaced as Logical error: 'Cannot convert nested result of function upper with type String to the expected result type FixedString(1048577): Query memory tracker: fault injected. ...' The same defect was fixed in the sibling FunctionVariantAdaptor by ClickHouse#102855, which guarded all seven of its cast sites. This applies that guard verbatim to the three relabel sites the Dynamic adaptor still had unguarded. Only the four type-conversion error codes are still relabelled, so the diagnostic for a real adaptor type-contract bug is preserved byte for byte, and every other exception keeps its own code, message and stack. The four remaining castColumn calls in the file (the isDynamic(result_type) paths) are deliberately left alone: they carry no relabel, so they cannot misclassify anything, and wrapping them would add new abort paths.
|
Internal second-model review: adjudication log (click to expand)
Pre-publication review by an independent model (engine: codex; 0 findings; coverage: all three
Severity: ❌ blocker / ⚠️ major / 💡 nit. Two claims I re-measured independently rather than taking from the write-up, since both decide
Session id: cron:clickhouse-review-slot-10:20260921-053006 |
Sorry, something went wrong.
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20260921-041800 |
Sorry, something went wrong.
|
Workflow [PR], commit [31dae11] Summary: ⏳
AI ReviewSummaryThis PR narrows the three FunctionDynamicAdaptor relabel sites so that only actual type-conversion failures are rewritten to LOGICAL_ERROR, while unrelated exceptions such as MEMORY_LIMIT_EXCEEDED keep their original code, message, and stack. The changed paths match the earlier FunctionVariantAdaptor fix, and the new stateless test covers all three relabel sites with focused repro cases. I did not find a remaining correctness, safety, or evidence gap in the current diff. Final VerdictStatus: ✅ Approve |
Sorry, something went wrong.
Build profile diff (arm_release)Comparing 31dae1165 with master de0734db6 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it). ✅ No significant changes. Binary sizesprograms/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction. The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does. Compile time of recompiled translation units7 translation units recompiled, 7 s compile time in total, 7 of them have a recent master baseline. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Related: #102855
Related: #115982
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed FunctionDynamicAdaptor reporting LOGICAL_ERROR for a function over a Dynamic column when an unrelated exception, such as MEMORY_LIMIT_EXCEEDED, was raised while converting the nested result to the declared result type. Such exceptions now keep their own error code, message and stack instead of being reported as an internal error.
Description
ExecutableFunctionDynamicAdaptor::executeImpl calls castColumn to reconcile a nested function's result type with the one it declares for Dynamic arguments. Three of those calls wrapped every DB::Exception the cast could raise into LOGICAL_ERROR without inspecting e.code(). That check runs in the Exception constructor, so no caller can intercept it: a debug or sanitizer server dies, and a release build reports code 49 for what is code 241, burying the OOM signal.
Observed on master in Stress test (arm_asan_ubsan) for a1cfa11 (report), where an injected memory-tracker fault surfaced as:
That message prints its two type names in swapped slots: the cast runs FixedString(1048577) to String.
#102855 fixed the identical defect in the sibling FunctionVariantAdaptor, guarding all seven of its cast sites. This applies that guard verbatim to the three the Dynamic adaptor still has unguarded, on master and on every release branch from 24.10 to 26.9.
Nothing is downgraded: the four type-conversion codes are still relabelled, so a value-dependent failure reporting one still becomes LOGICAL_ERROR. Only the first site is observed in CI; the other two are fixed for consistency, and the four castColumn calls that carry no relabel are left alone, since wrapping them would add abort paths.
New test 05233_dynamic_adaptor_propagate_exceptions covers all three sites with a real max_memory_usage aimed inside the cast; each case reproduces the message above on an unfixed binary.
CIDB: the two nested-exception classes behind this shared message (90 days)The TYPE class is the JSON_EXISTS-over-Dynamic divergence that #109944 fixed at the call site;
it is still arriving, which is why the LOGICAL_ERROR relabel is narrowed here rather than removed.
The RESOURCE row is this defect.
Workflow [PR]
Sync PR [sync-upstream/pr/121280]