Repository navigation
Fix flaky/slow test_s3_glob_scheherazade - #110167
alexey-milovidov merged 3 commits into
Conversation
The test wrote 1001 night_<i>/tale.csv objects with 30 Python threads, each doing a sequential single-row INSERT ... VALUES round-trip to S3 (~1001 round-trips, ~10 min). Under ASan-server load a writer connection hit Code: 210 Broken pipe (NETWORK_ERROR); the thread died silently (threading.Thread swallows the exception, join() returns), so the glob then read a partial object set and returned a short count (e.g. 509/779/783 instead of 1001). It is a write-side race, not an S3 listing bug. Replace the threaded writer with server-side partitioned inserts, batched to bound the number of concurrently open partition write buffers. All 1001 objects are written without client threads or ~1000 round-trips. column1 carries the night index, so the assertion is strengthened to 500500 for sum(column1), verifying every distinct file exists. Closes: ClickHouse#110165
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260712-154900 |
|
cc @kssenii — could you review this? It rewrites test_s3_glob_scheherazade to write the 1001 objects with server-side partitioned inserts instead of 30 Python threads doing sequential single-row S3 inserts, fixing a silent-thread-death write race (short counts) and the ~10 min runtime. |
|
Workflow [PR], commit [4d3c38f] Summary: ✅ AI ReviewSummaryThis PR rewrites the two S3 glob integration tests that exercise the Final Verdict✅ No remaining review findings in the current diff. |
Add a direct object-count assertion (len(list_objects(prefix=night_)) == 1001) after the partitioned writes, so the test still proves the glob lists more than 1000 separate objects even if partitioned writes ever coalesced partitions into fewer objects. Keep the row-level count()/sum(column1) query as a second check. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Done in 5cddba9. Added a direct object-cardinality assertion right after the writes and kept the row-level query as the second check: night_objects = list(
started_cluster.minio_client.list_objects(
bucket, prefix="night_", recursive=True
)
)
assert len(night_objects) == 1001This restores the Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260712-173400 |
Same server-side partitioned insert rewrite applied to the sibling test: replace the fire-and-forget threaded single-row writers (whose QueryRuntimeException would die silently in the worker and let the final count go short) with batched server-side partitioned inserts, and assert the folder1 object cardinality (len == 1008) directly so a coalescing of partitions can no longer pass unnoticed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Applied the same rewrite to the sibling Verified locally against MinIO: Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-4:20260712-181200 |
CI finish ledger — 4d3c38fFinish Workflow, Mergeable Check, and PR all green. Zero failures (49 pass, 125 skipping). Both clickhouse-gh[bot] change-requests addressed (direct object-cardinality asserts for Session id: cron:our-pr-ci-monitor:20260712-210000 |
…cheherazade-flaky Fix flaky/slow test_s3_glob_scheherazade
Closes: #110165
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_s3_glob_scheherazadewas slow (~10 min/run) and flaky. It wrote 1001night_<i>/tale.csvobjects with 30 Python threads each doing sequential single-rowINSERT ... VALUESround-trips. Under ASan-server load a writer connection hitCode: 210 Broken pipe (NETWORK_ERROR)and the thread died silently (threading.Threadswallows the exception,join()returns), so the following glob read a partial object set and returned a shortcount()(e.g. 509/779/783 instead of 1001). It is a write-side race, not an S3 listing bug.Replaces the threaded writer with server-side partitioned inserts, batched to bound the number of concurrently open partition write buffers. All 1001 objects are written without client threads or ~1000 round-trips.
column1carries the night index, so the assertion is strengthened to1001 500500 1001 1001(sum(column1) = 0+...+1000), verifying every distinct file exists.Verified locally: the test passes in ~34s (was ~10 min and failing 3/3 in the flaky check).
Reported from @ alexey-milovidov's investigation on #109310.
Version info
26.7.1.836(included in26.7and later)