Repository navigation
Do not fail internal system-log ALTER when the metadata exceeds max_query_size - #111703
Merged
alexey-milovidov merged 2 commits intoJul 24, 2026
Merged
Conversation
…x_query_size`
The metadata of `system.metric_log` has outgrown the default
`max_query_size` (273438 bytes vs 262144), so the internal
`ALTER TABLE ... MODIFY SETTING table_readonly` issued when a rotated
system log table is marked readonly started to fail with
`QUERY_IS_TOO_LARGE`, logging an `Error` on every rotation:
SystemLog (system.metric_log): Failed to mark the rotated system log
table as readonly; continuing with rotation: Code: 229. DB::Exception:
The resulting metadata of table system.metric_log_0 (273438 bytes)
would exceed max_query_size (262144), which would make the table
unloadable.
This makes the Upgrade check red on every PR since the 26.7 -> 26.8
version cut (observed on at least 7 unrelated PRs on 2026-07-23).
Loading table metadata at startup parses it with an unlimited query
size, so the validation is not needed for this internally generated
query: disable `max_query_size` for the `Alter` query kind in
`SystemLog::addSettingsForQuery`.
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101039&sha=0d8a6d9170b529147c77cfc038993a22b4f4fae9&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
Related: #101039
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Workflow [PR], commit [5c7da5a] Summary: ✅
AI ReviewSummaryThis PR disables Final Verdict✅ No new findings. |
1 task done
This was referenced Jul 24, 2026
Closed
This was referenced Jul 24, 2026
This was referenced Jul 24, 2026
This was referenced Jul 24, 2026
This was referenced Jul 24, 2026
Merged
…only-alter-max-query-size
Algunenano
approved these changes
Jul 24, 2026
Algunenano
left a comment
Member
There was a problem hiding this comment.
Looks like this was caused by #108283
1 task done
This was referenced Jul 25, 2026
This was referenced Jul 25, 2026
Merged
alexey-milovidov
added a commit
to niyue/ClickHouse
that referenced
this pull request
Jul 25, 2026
…olumn-matcher Pulls in the fixes for the unrelated Upgrade check failures: ClickHouse#111671 (move `join_runtime_filter_min_probe_rows` settings-history entry to the correct section) and ClickHouse#111703 (fix `metric_log` rotation readonly-ALTER exceeding `max_query_size`). Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105045&sha=d406cf6a81dd0a897336361b40986a51245de652&name_0=PR
This was referenced Jul 25, 2026
This was referenced Jul 26, 2026
Open
1 task done
CheSema
added a commit
that referenced
this pull request
Jul 27, 2026
… 26.7 The 26.7 release shipped only the extracted subset (use_reader_executor, long connections, min_bytes_for_seek, max_tail_for_drain at 1 MiB); the history entries claiming 26.7 for the rest are false against the released binary and fail the Upgrade check. Move the six query settings and the four merge_reader_executor_* MergeTree settings to 26.8 blocks, correct the 26.7 max_tail_for_drain entry to the shipped 1 MiB default, and record its 26.8 change to 512 KiB. The remaining Upgrade check error (system.metric_log rotation metadata exceeding max_query_size) is master's own overshoot, fixed upstream by #111703 - it resolves at the next master merge. Upgrade check: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103706&sha=db1d34500b14b171117092618c8756b43ab26482&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…eadonly-alter-max-query-size Do not fail internal system-log ALTER when the metadata exceeds max_query_size
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
The internal
ALTER TABLE ... MODIFY SETTING table_readonlythat marks a rotated system log table as readonly no longer fails withQUERY_IS_TOO_LARGEwhen the table's metadata exceedsmax_query_size(assystem.metric_log's metadata now does).Description
The metadata of
system.metric_loghas outgrown the defaultmax_query_size(273438 bytes vs 262144), so the internalALTER TABLE ... MODIFY SETTING table_readonlyissued when a rotated system log table is marked readonly fails withQUERY_IS_TOO_LARGEand logs anErroron every rotation:Since the 26.7 → 26.8 version cut this makes the
Error message in clickhouse-server.logtest of the Upgrade check red on unrelated PRs (observed on at least 7 different PRs on 2026-07-23, per CIDB).Loading table metadata at startup parses it with an unlimited query size (
DatabaseOnDisk::parseQueryFromMetadatapassesmax_query_size = 0totryParseQuery), so the size validation inDatabaseOrdinary::alterTableis not needed for this internally generated query. Disablemax_query_sizefor theAlterquery kind inSystemLog::addSettingsForQuery, next to the existing internal-query relaxations forInsertandRename.Report where this was observed: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101039&sha=0d8a6d9170b529147c77cfc038993a22b4f4fae9&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
Related: #101039
Related: #95079
Version info
26.8.1.102(included in26.8and later)