Repository navigation
Bound 03247 by time and check the CREATE OR REPLACE errors of 03237, 03238, 03247, 03248 - #122662
Conversation
…k its errors 03247 runs 20 threads x 20 `CREATE OR REPLACE TABLE` of the same table over HTTP. The statements are serialized on the table name. With the database metadata on the plain_rewritable remote disk of the `db disk` lanes, every metadata commit on that disk takes one disk-wide lock and holds it across its S3 requests, and each statement holds the database mutex across twelve such commits. Under the DDL load of the targeted check each statement then costs 0.6-1 s, so the 400 statements take 260-384 s, over the 180 s limit, in every run of `Stateless tests (amd_asan_ubsan, db disk, distributed plan, targeted)`, while every other lane finishes in under 38 s. Stop each thread after 60 s, as 03238 does. In the other lanes all 400 statements still run. Also stop discarding the output of the statements. Since aae8725 moved them from clickhouse-client to curl, `> /dev/null` swallowed the exception text of a failing statement (curl without `--fail` returns it in the body of the HTTP 500), so the test could no longer catch the `TABLE_ALREADY_EXISTS` collision of the temporary table names it was written for (ClickHouse#73364). A successful DDL over HTTP prints nothing. Failing jobs: https://github.com/ClickHouse/ClickHouse/actions/runs/36387258399/job/108826166989 https://github.com/ClickHouse/ClickHouse/actions/runs/36001665068/job/107660637803 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), plus a cold review by a separate reviewer session (1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20260928-104100 |
|
Workflow [PR], commit [7fc460a] Summary: ✅ AI ReviewSummaryThis PR bounds Findings
Final VerdictStatus: Minimum required action:
|
Since aae8725 moved the create loop of 03237 from clickhouse-client to curl, `> /dev/null` swallowed the exception text of a failing `CREATE OR REPLACE VIEW` (curl without `--fail` returns it in the body of the HTTP 500), the same way it did in 03247. A successful DDL over HTTP prints nothing. With a syntax error injected into the statement the test now fails with `having exception in stdout`, while the old one passes. 50 randomized runs pass on local disks and 50 on an S3 database disk, with all 10050 statements of each set succeeding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and 03248 b17a0bc (03238) and e834d42 (03248) moved these `Replicated` database tests from clickhouse-client to curl and kept `> /dev/null`. With clickhouse-client that only dropped the DDL status row, because the exception went to stderr. With curl the exception text is in the body of the HTTP 500, so a failing statement could no longer fail either test, the same way 03237 and 03247 went blind. The `CREATE OR REPLACE` statements now pass `distributed_ddl_output_mode=none`, so a successful one prints no status row and a failing one prints its exception. The select loop of 03238 runs `FORMAT NULL` and drops only `UNKNOWN_TABLE` and `TABLE_UUID_MISMATCH`, as the select loop of 03237 does; they are the codes of the 12 CI failures of that loop in 2025, while its check was still live. With a failing statement injected into a loop, both tests now fail with `having exception in stdout`, while the old ones pass. 50 randomized runs of each test pass on a debug and on an ASan build, with every statement succeeding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CREATE OR REPLACE errors of 03237, 03238, 03247, 03248
| $CLICKHOUSE_CLIENT --query "CREATE DATABASE IF NOT EXISTS ${CLICKHOUSE_DATABASE}_db ENGINE=Atomic" | ||
|
|
||
| # The statements are serialized on the table name and can take a second each with the database metadata on a remote disk. | ||
| export TIMEOUT=60 |
There was a problem hiding this comment.
This fixes the timeout, but it also turns 03247 from a fixed 400-operation stress test into a pure wall-clock loop with no lower bound on work done. On the slow db disk lane that motivated this patch, a future slowdown can now make the test pass after only a small fraction of the original CREATE OR REPLACE attempts, which silently removes most of the concurrency pressure that was catching TABLE_ALREADY_EXISTS regressions. Other time-bounded stateless stress tests usually keep a minimum-iterations assertion for exactly this reason (for example 01171_mv_select_insert_isolation_long.sh).
Could we keep the 60s cap but count completed iterations and fail if they drop below a floor?
There was a problem hiding this comment.
I checked it, and a floor would not add coverage here:
- The
$SECONDScheck runs after each request, so each of the 20 threads sends at least oneCREATE OR REPLACE, and they all start together. The minimum is 20 concurrent statements. - That minimum still catches the bug this test was added for. With a constant
random_suffixindoCreateOrReplaceTableandTIMEOUT=0(exactly one statement per thread), the test failed 20 of 20 runs withTABLE_ALREADY_EXISTS, with 12 to 19 of the 20 statements failing in each run. The unmodified build passed 20 of 20. - On the slowest lane,
Stateless tests (amd_asan_ubsan, db disk, distributed plan, targeted), the bound stops each run after 246 to 307 of the 400 statements (67 to 69 s).
A floor above 20 would only fail when the statements get slower, which is the timing failure this PR removes. If you still want one, I'll add it.
Related: #73364
Related: #118490
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Test-only change, no changelog entry required.
Description
03247_create-same-table-concurrently-with-atomic-enginehas never passed inStateless tests (amd_asan_ubsan, db disk, distributed plan, targeted): all 8 runs from 2026-09-07 to 2026-09-28 (two code-disjoint PRs) failTest runs too long (> 180s)at 260-384 s. Every other lane finishes it in under 38 s. The check is required, so this reds every PR whose targeted selection includes the test.Failing jobs:
https://github.com/ClickHouse/ClickHouse/actions/runs/36387258399/job/108826166989
https://github.com/ClickHouse/ClickHouse/actions/runs/36001665068/job/107660637803
The test runs 20 threads x 20
CREATE OR REPLACE TABLEof one table, serialized on the table name. Withdatabase_diskon theplain_rewritableS3 disk of that lane, every metadata commit holds a disk-wide lock across its S3 requests, and each statement holds the database mutex across twelve such commits. Under the targeted check's DDL load a statement costs 0.6-1 s (measured in the failing job's logs).Each thread now stops after 60 s, as in
03238; elsewhere all 400 statements run. I also dropped> /dev/nullfrom theCREATE OR REPLACEloops of this test and of03237,03238,03248: sinceaae87258996be,b17a0bc24fd63ande834d425cd366moved them to curl, a failing statement (exception text in the HTTP 500 body) could not fail them, e.g. theTABLE_ALREADY_EXISTScollision of #73364. TheReplicatedones passdistributed_ddl_output_mode=none(no status row on success); the select loop of03238now matches03237.Validation on a MinIO database disk at 20 ms RTT: old 419 s and 419 s FAIL (
> 180s), new 78 s and 76 s OK. 50/50 randomized runs of each test pass, no statement failing. With a constant temporary-table suffix the new03247fails withTABLE_ALREADY_EXISTSwhile the old one passes with 270 of 400 statements failing; a failing statement injected into the siblings likewise fails the new tests only.Nine of the twelve commits are no-op
createDirectories; not changed here (plain_rewritablelocking is being reworked in #118490).Workflow [PR]
Sync PR [sync-upstream/pr/122662]
Version info
26.10.1.1478-master(included in26.10and later)