Repository navigation
Bound the system.text_log scans in two deduplication log tests - #122525
Conversation
04640_deduplication_log_reattach_no_phantom_blobs and 05258_deduplication_log_alter_window_no_phantom_blobs end with a count() over system.text_log that filters only on level and message. Neither column is in the table's key (ORDER BY (event_date, event_time)), so the read selects every granule, and once a long parallel run has logged more than 20 million rows the query fails with TOO_MANY_ROWS against max_rows_to_read = 20000000 from tests/config/users.d/limits.yaml (seen in the CH Inc sync check: "current rows: 20.31 million", query 15, line 39 of 05258). Apply the two levers already used for this family of tests: - event_date >= yesterday() AND event_time >= now() - 600, the convention of 9eaf025 and b8c39c9, so the primary key prunes the read to the last ten minutes; - SETTINGS max_rows_to_read = 0, as in ClickHouse#103290, because the window alone can exceed the limit on a log-heavy run (a time-bounded query of 00956_sensitive_data_masking failed at 21.28 million rows in the CI of PR 103706). The bound cannot hide a real error row: the row is logged by the test's own ATTACH shortly before the check, these tests are killed after 600 s (the runner's --timeout default, which CI keeps; they are not tagged long), and yesterday() leaves a day of slack against the randomized session_timezone. Validated on master e5b8853 with the CI config overlay and a local MinIO, with a text_log of 21 million rows: the unmodified tests fail 6/6 with the same TOO_MANY_ROWS, the fixed ones pass 6/6, also with 21 million rows inside the window (their SELECT then reads 21.02 million rows); a corrupted deduplication log is still counted (base and fixed check both return 1); 100/100 randomized runs pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings; bounded: 1 full pass + 1 fix round + 1 delta recheck). No findings on the two changed queries. My own review before publication found wording issues only, in the description and the commit message, and those were fixed before the push. Session id: cron:clickhouse-review-slot-48:20260927-111400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20260927-094900 |
|
Workflow [PR], commit [1c9893c] Summary: ✅ AI ReviewSummaryThis PR narrows the final Final Verdict✅ No findings. |
04909_row_policy_serialized_plan_route failed once in Stateless tests (arm_asan_ubsan, azure, parallel) with "parallel replicas 0" instead of 2: https://github.com/ClickHouse/ClickHouse/actions/runs/36327000258/job/108667110916 Both remote replicas had received the plan ("Received query plan" in the server log), but the initiator's local replica claimed all 17375 marks before either of them announced, so the coordinator cancelled them ("All ranges for reading has been assigned to replicas. Cancelling execution for unused replicas. Used replicas: 0"). They logged ExceptionBeforeStart with QUERY_WAS_CANCELLED_BY_CLIENT, and the oracle counted only QueryFinish rows. - Count a secondary query by any terminal query_log row, not only QueryFinish. - Re-run the query, up to three attempts, when fewer than two secondary queries appear: the coordinator can also cancel a replica before its query is sent at all, which leaves nothing to observe. - Bound both system log scans to the last ten minutes, as in ClickHouse#122525. Each poll scanned two days of text_log, up to 12 s per poll in the failing job, 280 s for the whole test. Reproduced on a local server with failpoints: parallel_replicas_delay_announcement (replicas cancelled after they received the plan) turns the old test red with "parallel replicas 0", and remote_query_executor_cancel_before_send (a replica never contacted) with "parallel replicas 1". The new test passes both, and removing either change reddens its own case. With the plan replaced by query text (serialize_query_plan = 0) the arm still fails with 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The final assertion joined `system.text_log` with no predicate, so the whole table was read as the join's build side and, on a log-heavy CI server, exceeded the `max_rows_to_read = 20000000` of `tests/config/users.d/limits.yaml` (`TOO_MANY_ROWS`, query 35, line 53, reported from the CH Inc sync check on ClickHouse#100394). Read `text_log` through a subquery bounded by its primary key to the last 10 minutes and lift the row limit for that statement, as ClickHouse#103290 and ClickHouse#122525 do. The bound stays inside the subquery so the `LEFT JOIN` keeps the queries that log no row store line. The joined rows are written by the test's own queries, and the test is killed after 600 s, so they are always inside the window. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #121670
Related: #122432
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04640_deduplication_log_reattach_no_phantom_blobsand05258_deduplication_log_alter_window_no_phantom_blobsend with acount()oversystem.text_logfiltered only bylevelandmessage. The table's key is(event_date, event_time), so the read selects every granule, and late in a long parallel run it exceeds themax_rows_to_read = 20000000oftests/config/users.d/limits.yaml. Seen for 05258 in the CH Inc sync check:Change. The two levers the rest of this family uses:
event_date >= yesterday() AND event_time >= now() - 600(as in9eaf0258dee1bandb8c39c9011b2), so the primary key prunes the read to the last ten minutes, andSETTINGS max_rows_to_read = 0, which #103290 added to scans that already had this bound and still exceeded the limit on log-heavy runs. The error row the check looks for is logged by the test's ownATTACH, well inside the window (these tests are killed after 600 s).Validation (master
e5b8853baca3fdebug build, CI config overlay, local MinIO,system.text_logpadded to 21M rows):TOO_MANY_ROWS(query 13 line 36 of 04640, query 15 line 39 of 05258);About 25 other tests read
system.text_logwithout a bound too; none has failed this way in public CI or been reported from CH Inc sync, so only 05258 and its twin 04640 change here.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122525]
Version info
26.10.1.832-master(included in26.10and later)