Repository navigation
Conversation
|
Workflow [PR], commit [3a82c00] Summary: ❌
AI Review
|
c5600d7 to
e87dbf1
Compare
|
failures appear unrelated, this should be good to go! |
|
@maxjustus, it requires documentation for new features:
|
- Rebase the original commit onto current master - Add documentation for `_decompress` and `_disable_checksum` parameters to satisfy the feature_docs CI check - Rename test from 03756 to 04040 (next available number) - Remove unnecessary `no-parallel` tag from test Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
e87dbf1 to
ab29e24
Compare
|
oh cool, looks like you took care of that. I think the CI fails are still unrelated |
…le_compression * upstream/master: (6651 commits) Update version_date.tsv and changelogs after v25.12.10.7-stable tests: correct `long` tag comment on 01114_database_atomic Harden lexer and UTF-8 subsequence for fuzzer sanitizers add guard to getURLScheme - found by unit test Fix flaky test 02818_memory_profiler_sample_min_max_allocation_size on amd_llvm_coverage tests: mark 01114_database_atomic as long to avoid flaky-check 180s cap better test Squashed commit of the following: Add regression test for SIGSEGV in full_sorting_merge LEFT JOIN with JSON columns Pack hot `MemoryTracker` fields into a single cache line Avoid false sharing in `MemoryTracker` via cache-line field grouping Update comment for MemoryTracker impl CI: print stack trace on `ServerDied` exception Retrigger CI after DNS infrastructure flake (no code change) Removed test CI: move macOS fast test skip list to `ci/defs/darwin.skip` and add more tests Fix flaky test 03008_uniq_exact_equal_ranges under MSan/WasmEdge Fix flaky test 01872_functions_to_subcolumns_analyzer Fix BSONEachRow rollback crash on malformed nullable array elements ...
|
Ok, now it is almost perfect. There is one pending, reasonable suggestion from the reviewer. |
…ble data in HTTP multipart requests
04040 and 04114 collided with tests added on master; renumber to 04310 and 04311. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…abase The test created a fixed global user `test_decompress_limit_user`. Because ClickHouse users are server-global, running the test concurrently (as the flaky check does) caused `ACCESS_ENTITY_ALREADY_EXISTS` on `CREATE USER` and `UNKNOWN_USER` on `DROP USER`. Scope the user name to `CLICKHOUSE_DATABASE` so parallel runs do not collide. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Picked this up to move it forward:
Verified locally on a freshly built binary — both Remaining red CI before the merge was unrelated to this change:
These should be re-evaluated after CI re-runs on the merged branch; |
…HTTP data The reviewer noted that wrapping the `CompressedReadBuffer` in a `LimitReadBuffer` bounded by `http_max_multipart_form_data_size` is too late to stop a decompression bomb: `CompressedReadBuffer::nextImpl` reads `size_decompressed` from the (untrusted) block header and calls `memory.resize(size_decompressed + ...)` before the outer limit can cap the read. Only `size_compressed_without_checksum` was bounded (against `DBMS_MAX_COMPRESSED_SIZE`), so a tiny crafted block declaring a huge decompressed size could still force an oversized allocation. Add an optional per-block decompressed-size limit to `CompressedReadBufferBase` (`setDecompressedSizeLimit`, default disabled). When set, `readCompressedData` rejects a block whose declared decompressed size exceeds the limit with `TOO_LARGE_SIZE_COMPRESSED`, before any decompressed buffer is allocated. `ExternalTable` now sets this limit to `http_max_multipart_form_data_size` on the external-data path, while keeping the outer `LimitReadBuffer` as the total-stream guard. Tests (renumbered to avoid collisions with new master tests): - `04322_http_external_table_native_compressed` - `04323_http_external_table_decompression_limit` now exercises the cumulative total-limit path (blocks individually under the limit, total over it -> `CANNOT_READ_ALL_DATA`). - `04324_http_external_table_decompression_bomb` (new) crafts a single block whose declared decompressed size exceeds the limit and asserts it is rejected with `TOO_LARGE_SIZE_COMPRESSED` before allocation. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Continued moving this forward:
Verified locally on a freshly built binary — The remaining red CI is unrelated to this change: @groeneai, please investigate the unrelated |
|
@ alexey-milovidov picked up the directive to investigate STID CIDB confirms it is unrelated to this PR: the STID is fresh (single hit on this PR's Investigating in a separate branch; will open the fix PR shortly and link it back here. Session: cron:clickhouse-ci-task-worker:20260606-121600. |
|
@ alexey-milovidov status update on STID CIDB: still 1 hit in the last 30 days, the original one on this PR's GitHub: searched for Code path: the assertion at The fuzzer-mutated trigger was an outer Reading That asymmetry is the most plausible mechanism: a scalar subquery evaluated under Status: monitoring CIDB for any recurrence. If a second hit lands, I will reopen with the new artifact (ideally a debug Any additional context (fuzzer artifacts still around, prior duplicate-announcement family, expected occasional outcome of the new Session: cron:clickhouse-ci-task-worker:20260608-000500. |
|
@ alexey-milovidov second update on STID Reproduction attempt (master HEAD 38129a8, debug build): I tried to reproduce the duplicate-announcement crash from the fuzzer's "Failed query" (
The fuzzer's printed query as-is is rejected at parse time: This strongly suggests the printed "Failed query" is not the mutation that actually caused the crash — it is just the last query the fuzzer attempted. The AST fuzzer reuses the server across many mutated queries; the duplicate-announcement state was almost certainly produced by an earlier mutation that left the parallel-replicas coordinator in a bad state, and the printed query is what was running when the crash surfaced. Code state on current master (relevant to the hypothesized asymmetry I posted earlier):
Conclusion: the printed query alone is not a deterministic reproducer; without the fuzzer's preceding-query history or a server core, I cannot pin down which mutation actually leaked a duplicate announcement into the coordinator. CIDB still shows 1 hit in 30 days, no master / cross-PR recurrence in the 4 days since. I am going to stand down on a speculative fix per @ Algunenano / @ Avogar guidance ("avoid making code changes that you can back with test, queries or reports"). I'll keep CIDB monitoring on the STID and reopen if a second hit lands — ideally with the fatal.log / server.log / coredump from the AST-fuzzer artifact directory so we can identify the actual crash-triggering mutation. If the fuzzer artifacts (server.log, fatal.log, core) for sha Session: cron:clickhouse-ci-task-worker:20260608-051225. |
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…_compression Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # src/Core/Settings.cpp
…uest_header_size` A content line starting with "\r\n--<boundary>" terminates the part, so it is request syntax rather than content. Previously the structural limit was checked for it only after the line had outgrown the content limit, so with a large `http_max_multipart_form_data_size` such a line with a long tail could be buffered far beyond the user's `http_max_request_header_size`. Now it is checked as soon as the line outgrows the structural limit. Also fix the first line of a part's content being bounded by `http_max_request_header_size` instead of the content limit: `readHeaders` peeks past the empty line that ends the headers, so `MultipartReadBuffer` buffered that line before `readMultipart` switched it to content mode, and a valid first content line longer than the user's header size limit was rejected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tipart budget `http_max_multipart_form_data_size` is a budget shared by all parts of the request, but each native-compressed (`_decompress`) part got the whole limit for its decompressed size, so several small compressed parts could materialize more external data than the limit. Limit each part by what is left of the budget after the previous parts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…arts too The form field name of a part with `filename` (an external table) was passed to `PartHandler::handlePart` without the length check, so it could exceed the authenticated user's `http_max_field_name_size`. Check it before the `filename` split. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t content limit Once a buffered content line matched the full `\r\n--<boundary>` prefix, any suffix was accepted up to `http_max_request_header_size` and then discarded as a boundary line, so bytes could be smuggled past `http_max_multipart_form_data_size`. Past the boundary, accept only the `--` of the close delimiter and linear whitespace (RFC 2046). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Continued this PR:
|
# Conflicts: # src/Compression/CompressedReadBufferBase.h
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/PRs/93462/69b8ac7f23627a56d220701b8a6ecbba47c7cafb/pr/unit_tests_asan_ubsan_function_prop_fuzzer/unit_tests_asan_ubsan_function_prop_fuzzer.log ( |
|
Fixed by my #126210, merged 2026-10-20 at 13:10 UTC. This run predates it: the workflow for Since the merge, master-based runs of this job have 3 failures out of 2483 (0 of 250 on |
|
🕵 Merged CI on the previous head (
@groeneai, thanks for confirming the There are no unresolved review threads. |
…arts - `CompressedReadBufferBase`: add `setCompressedSizeLimit`, which bounds the cumulative declared compressed size (including checksums) before a buffer for the block is allocated. `ExternalTablesHandler` sets it to the remaining `http_max_multipart_form_data_size` budget, so a header-only block declaring a huge compressed size is rejected up front instead of forcing a large allocation before `readStrict` notices the truncated input. - `HTMLForm::MultipartReadBuffer::skipToNextBoundary`: initialize the part state (`first_line_of_part`, `found_last_boundary`) before `next` reads ahead the first line of the part. Otherwise the flag was consumed by the second header line, which was then taken for content and rejected by the content size limit. Both cases are covered by a new test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…_compression Conflict in `src/Core/Settings.cpp`: the descriptions of `http_max_fields`, `http_max_field_name_size` and `http_max_field_value_size` were changed on both sides. Kept the text of this PR (query string is bounded by the server default before authentication) and appended the paragraph from `master` about the headers of HTTP responses read as a client. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ry recognizers The RFC 2046 check of what may follow the boundary on a delimiter line (the `--` of the close delimiter and linear whitespace) was applied only to a content line that had already outgrown `http_max_multipart_form_data_size`. Below that limit, `MultipartReadBuffer::nextImpl` and `skipToNextBoundary` took any line starting with the boundary for a delimiter, so a line such as `--<boundary>garbage` silently truncated the part. The check is now shared: `isValidDelimiterSuffixByte` is used by the over-limit path in `readLine`, and `checkDelimiterSuffix` validates the complete line in both boundary recognizers. A line that starts with the boundary but is not a valid delimiter line is rejected as malformed input. Added `05839_http_multipart_malformed_boundary_line`, where all lines stay far below both size limits. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
🕵 Merged Addressed the remaining review thread in 3a82c00: the multipart boundary recognizers now reject a line that starts with the boundary but is not a valid delimiter line, instead of silently truncating the part. New test: Verified locally on the merged build: the new test and the 23 other multipart / external-table HTTP tests of this PR pass. |
| /// But we could not just skip all parameters with suffixes '_format', '_types', '_structure', | ||
| /// because some of them are used in the query as a settings, like 'date_time_input_format', | ||
| static const Names reserved_param_suffixes = {"_format", "_types", "_structure"}; | ||
| static const Names reserved_param_suffixes = {"_format", "_types", "_structure", "_decompress", "_disable_checksum"}; |
There was a problem hiding this comment.
[Major] Adding _decompress and _disable_checksum to this generic suffix skip breaks legitimate handler/query parameters on any multipart request with external tables. The main parameter loop checks param_could_be_skipped before customizeQueryParam, so param_codec_decompress=..., a declared handler parameter like foo_disable_checksum, or even a custom query_param_name ending with one of these suffixes is discarded here as soon as has_external_data is true. That turns unrelated handlers into "missing parameter" / "query not found" failures that were not external-table metadata before this change.
Can we either let customizeQueryParam claim handler/query parameters first, or exempt param_* / declared handler parameters from this suffix filter and apply it only to otherwise-unrecognized names?
|
📊 Cloud Performance Report
PR verdict: not_sure. 1 measured difference(s) not attributable to this PR. clickbench Q31: The measured difference cannot be attributed to this PR from the available source evidence. Tested merge a501b50a (first parent 6a2b727a, PR head e317f3d) changes src/Core/ExternalTable.cpp, src/Server/HTTP/HTMLForm.cpp/.h, src/Server/HTTPHandler.cpp, src/Core/Settings.cpp (doc strings only) and src/Compression/CompressedReadBufferBase.cpp/.h. This query is a GROUP BY WatchID, ClientIP over hits. It does read MergeTree columns through CompressedReadBufferBase::readCompressedData, but the new code there is two clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add support for native compression with external tables via HTTP.
Documentation entry for user-facing changes
Workflow [PR]
Sync PR [sync-upstream/pr/93462]