Skip to content

Add test: max_table_size_rows: still-rejected growing part commit has no test - #120920

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr117229
Sep 20, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr117229

Conversation

@clickgapai

@clickgapai clickgapai commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Test-only PR. Review: are the gaps real, is the test right.

Adds test coverage for 1 untested code path, found during automated review of PR #117229.
That PR: (1) MergeTreeData::throwIfTableSizeLimitsExceeded (MergeTreeData.cpp:7930-7933) gains the shrinking carve-out the byte limits already had: a part commit whose part holds no more rows than the parts it covers (added_rows <= covered.rows) is exempt from max_table_size_rows, and a patch part …

1. max_table_size_rows: still-rejected growing part commit has no test
src/Storages/MergeTree/MergeTreeData.cpp:7931, src/Storages/MergeTree/MergeTreeData.cpp:7063
Risk: MergeTreeSink::finishDelayedChunk -> commitPart -> renameTempPartAndAdd -> renameTempPartAndReplaceImpl (MergeTreeData.cpp:7063) -> throwIfTableSizeLimitsExceeded(lock, part, covered_parts). The PR makes that throw conditional on is_shrinking_rows (MergeTreeData.cpp:7931); every …
Unique vs PR tests: 05227 (the PR's own test) and 04910 pin only the allowed side of the new predicate - merges and deleting mutations that do not add rows commit on an over-limit table. Their rejection cases (INSERT ... { serverError TABLE_SIZE_LIMIT_EXCEEDED }) all hit the pre-write check with added_part == … **Tags:** -- Tags: no-replicated-database—no-replicated-database: the test asserts how much of a partially rejected insert survives; with the Replicated database engine the table becomes ReplicatedMergeTreeand the parts are committed throughReplicatedMergeTreeSink` instead, which could not be verified locally (no ZooKeeper)
Try it on ClickHouse Fiddle

cc @alexey-milovidov (author of #117229) — could you take a look, and add the can be tested label if this looks good?

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Workflow [PR]
Sync PR [sync-upstream/pr/120920]

Version info

  • Merged into: 26.10.1.264-master (included in 26.10 and later)

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 18, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Sep 19, 2026
@alexey-milovidov alexey-milovidov self-assigned this Sep 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e716746]

Summary: ✅


AI Review

Summary

This PR adds a focused stateless test for the case where one INSERT is split into multiple parts and only the later part commit is rejected after the table has already crossed max_table_size_rows. I did not find a correctness problem in the new test: the fixture in 05229_max_table_size_rows_multiple_parts.sql exercises the delayed per-part commit path in MergeTreeSink::finishDelayedChunk and distinguishes it from the already-covered pre-insert rejection and shrinking-replacement cases.

Missing context / blind spots
  • ⚠️ I did not run the test locally because this checkout has no build artifacts or test runner available, so the validation here is source-only from tracing the current MergeTreeSink / MergeTreeData::throwIfTableSizeLimitsExceeded flow.
Final Verdict

✅ No new review findings.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 20, 2026
Merged via the queue into ClickHouse:master with commit 655481b Sep 20, 2026
176 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 20, 2026
@clickhouse-gh clickhouse-gh Bot added comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants