Repository navigation
Fix data race in Iceberg insert with a text data file format - #131515
Conversation
`MultipleFileWriter` created the output format with `getOutputFormatParallelIfPossible`. For a text format such as `JSON`, that is `ParallelFormattingOutputFormat`, whose collector thread writes to the data file buffer while `consume` reads `buffer->count()` to cut the file (since #127670): a data race reported by TSan. Use the non-parallel output format; the Iceberg data file formats are not formatted in parallel anyway. La Casa Del Dolor (amd_tsan), STID 1003-46d8, master, 2026-11-13: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=c1e69ea54ad361a685f9791174c1f7d22409ad2b&name_0=MasterCI&name_1=La%20Casa%20Del%20Dolor%20%28amd_tsan%29 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…64` columns Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [d9ee3fd] Summary: ✅
AI ReviewSummaryReviewed #131515 at Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; normal CI validation remains pending. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline. |
MultipleFileWritercreated the output format of an Iceberg data file withgetOutputFormatParallelIfPossible. For a text format such asJSONorCSV, that isParallelFormattingOutputFormat, whose collector thread writes to the data file buffer whileconsumereadsbuffer->count()to decide where to cut the file, a check added in #127670. TSan reports it as a data race (BufferBase::countinMultipleFileWriter::consumevsWriteBuffer::nextinParallelFormattingOutputFormat::collectorThreadFunction). The non-parallel output format is used now; the Iceberg data file formats are not formatted in parallel anyway (the Parquet writer encodes row groups in parallel itself and writes them on the calling thread).The new test inserts into a
JSONEachRowIceberg table with parallel formatting and a small file size limit, so that the files are cut while formatting.Found by La Casa Del Dolor (amd_tsan), STID 1003-46d8, master, 2026-11-13: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=c1e69ea54ad361a685f9791174c1f7d22409ad2b&name_0=MasterCI&name_1=La%20Casa%20Del%20Dolor%20%28amd_tsan%29
Related: #127670
Related: #127864
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a data race when inserting into an Iceberg table whose data files have a text format, such as
JSON.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131515]
Version info
26.11.1.2300-master(included in26.11and later)