Skip to content

Added fix for input_format_max_block_size_bytes silently ignored for INSERT - #103068

Merged
alexey-milovidov merged 11 commits into
masterfrom
input_format_max_block_size_bytes_silently_ignored_for_INSERT_operations
Jun 22, 2026
Merged

alexey-milovidov merged 11 commits into
masterfrom
input_format_max_block_size_bytes_silently_ignored_for_INSERT_operations

Conversation

@Fgrtue

@Fgrtue Fgrtue commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed input_format_max_block_size_bytes being silently ignored during INSERT parsing when max_insert_block_size_bytes is 0 (the default). The setting now correctly limits the size of blocks produced by row input formats.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Closes: #103059

Version info

  • Merged into: 26.6.1.1091

@clickhouse-gh

clickhouse-gh Bot commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [73d9bc2]

Summary: ✅


AI Review

Summary

This PR fixes the precedence between max_insert_block_size_bytes and input_format_max_block_size_bytes for row input formats: a positive insert-specific byte limit still overrides, while the disabled value 0 no longer masks the input-format byte limit. The added stateless HTTP insert regression test now scopes system.part_log checks by the explicit insert query_id, and the prior review concerns about stale log rows and style-check scoping are addressed in the current code.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 18, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

This was fixed by #105146. Let's update the branch.

alexey-milovidov and others added 7 commits May 17, 2026 21:04
…ock_size_bytes_silently_ignored_for_INSERT_operations
Address review feedback: the assertion counted `system.part_log` `NewPart`
rows for table `t_ifmbs_override` within a 600s time window. On a re-run the
test reuses the same database and table, so stale `NewPart` events from a
previous run could be counted, making the result flaky.

Set an explicit unique `query_id` on the INSERT and filter `system.part_log`
by it, so only the parts created by this exact INSERT are counted, regardless
of re-runs. The INSERT over HTTP is synchronous (`async_insert=0`), so all
`NewPart` events are recorded before the request returns; a single synchronous
`SYSTEM FLUSH LOGS part_log` makes them queryable, removing the polling loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ock_size_bytes_silently_ignored_for_INSERT_operations
The style check (`ci/jobs/scripts/check_style/various_checks.sh`) rejects
`.sh` tests that send `curl` requests and then read `system.part_log` /
`system.query_log` after a `SYSTEM FLUSH LOGS` without a retry loop, because
the log entries are written after the HTTP response is sent and reading them
immediately is racy (#84364).

The previous revision replaced the polling loop with a single synchronous
`SYSTEM FLUSH LOGS part_log`, which tripped this check. Restore a bounded
retry loop that flushes `query_log, part_log` and waits until the INSERT
appears in `system.query_log` as `QueryFinish` before reading
`system.part_log`, mirroring `03723_max_insert_block_size_bytes_http.sh`.
The deterministic `query_id` scoping of the `part_log` assertion is kept.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…g query

The Style check 'various' rule requires any test referencing `system.query_log`
to include a `current_database = currentDatabase()` condition. The wait-loop
query in `04104_input_format_max_block_size_bytes_override.sh` filtered only by
`query_id` and `event_date`, so the lint flagged it. Add the predicate; it also
correctly scopes the poll to this test's database.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ock_size_bytes_silently_ignored_for_INSERT_operations
@alexey-milovidov

Copy link
Copy Markdown
Member

Pushed 6e13ac6e33e..73d9bc2903f addressing the AI Review's required actions:

  • Style check (various): the wait-loop query against system.query_log was missing the current_database = currentDatabase() predicate that the lint requires. Added it (commit 39fc43c6368) — it also correctly scopes the poll to this test's database. Verified locally against the exact lint regexes in ci/jobs/scripts/check_style/various_checks.sh.
  • PR metadata: changed the changelog category to Bug Fix (user-visible misbehavior in an official stable release) (the setting shipped in a stable release via Implement the max_insert_block_size_bytes setting for Format Pasing #92833) and added a user-readable changelog entry.

Also merged fresh master (was 654 behind; master had touched FormatFactory.cpp for the GeoJSON input format — the merge was clean, no overlap with the 3-line getInputImpl change). Net functional diff vs master remains exactly 3 files: src/Formats/FormatFactory.cpp plus the test .sh/.reference.

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Jun 20, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.30% 85.30% +0.00%
Functions 92.50% 92.60% +0.10%
Branches 77.50% 77.50% +0.00%

Changed lines: Changed C/C++ lines covered by tests: 7/7 (100.00%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this Jun 22, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jun 22, 2026
Merged via the queue into master with commit b626b3a Jun 22, 2026
327 of 328 checks passed
@alexey-milovidov
alexey-milovidov deleted the input_format_max_block_size_bytes_silently_ignored_for_INSERT_operations branch June 22, 2026 00:17
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

input_format_max_block_size_bytes silently ignored for INSERT operations due to value_or receiving std::optional(0) instead of std::nullopt

3 participants