Repository navigation
Make test 00314_sample_factor_virtual_column five times faster under TSan - #124368
Conversation
The test created its tables with an explicit index_granularity of 10 and inserted 3M rows with min_insert_block_size_rows = 0, so every random max_block_size block (down to 8000 rows) became its own compact part with one compressed block per column per 10-row granule: ~600k compressed blocks written, decoded and re-encoded again by the background merges, and ~600k marks loaded by the SELECTs. Under TSan, with the random ZSTD server codec (a fresh context per block), a run took up to 296 s in the s3 parallel lane and failed the 180 s limit of the targeted check on PR ClickHouse#111248. Use the default granularity 8192 and clamp max_block_size to at least 65409. The asserted sum(_sample_factor) does not depend on granularity or part layout (exact row count for the relative sample size, exact intHash64 filter): measured identical (2997580 over 199910 rows) for granularity 10 and 8192 and block sizes 8188, 65409 and 100000. TSan, 18 concurrent runs on 32 CPUs: p50 51 s -> 8.3 s (ZSTD(1)), 32 s -> 7.1 s (LZ4), 51 s -> 9.6 s (S3 on MinIO). 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; 1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261007-054200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261007-051300 |
|
Workflow [PR], commit [a92d375] Summary: ✅ AI ReviewSummaryThis PR narrows the randomized layout of Final Verdict
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #111248
00314_sample_factor_virtual_columnfailed withTest runs too long (> 180s)(181.76 s) inStateless tests (amd_tsan, s3 storage, targeted)on #111248. It is slow on master too: over 30 days it took up to 296 s (p50 66 s) inamd_tsan, s3 storage, parallel.The tables had an explicit
index_granularityof 10, and the INSERTs setmin_insert_block_size_rows = 0, so every randommax_block_sizeblock (down to 8000 rows) became its own compact part with one compressed block per column per 10-row granule: about 600k compressed blocks written and merged, and 600k marks loaded by the SELECTs. The random server codecZSTDmakes each block more expensive under TSan (#122854 is the product-side change for that).The test now uses granularity 8192 and clamps
max_block_sizeto at least 65409. The data, both queries and the reference are unchanged.sum(_sample_factor)does not depend on the layout (the relative sample size comes from the exact row count, the sampling filter is exact): I measured the same 2997580 over 199910 rows for granularity 10 and 8192 with blocks of 8188, 65409 and 100000 rows. Each table still has at least 10 parts, and the primary key still prunes the sampled range.With the master TSan binary, 18 concurrent runs on 32 CPUs (the flaky check shape), p50 went from 51 s to 8.3 s with
ZSTD(1), 32 s to 7.1 s withLZ4, and 51 s to 9.6 s on S3 (MinIO). 50/50 randomized runs pass on TSan and debug. The clamp is checked insystem.query_log: nomax_block_sizebelow 65409, while a corrupted clamp line lets lower values through.Workflow [PR]
Sync PR [sync-upstream/pr/124368]
Version info
26.10.1.1715-master(included in26.10and later)