Repository navigation
Keep the case 6 tables of 04633_async_insert_select_alter_race on the local disk - #127751
Conversation
On the azure lane the default MergeTree policy is `azure_cache`, a write-through filesystem cache (`cache_on_write_operations = 1`), and the CI profile enables `enable_filesystem_cache_on_write_operations`. Every file a part writes then reserves cache space under the cache priority write lock, which debug and sanitizer builds also hold for their randomized full-cache consistency checks. In the failing job (PR ClickHouse#116361, `Stateless tests (arm_asan_ubsan, azure, parallel)`) the async-insert flush of case 6 held the table share lock while it waited 13.1 s of a 13.3 s query on that lock (`FilesystemCachePriorityWriteLockMicroseconds`), and the view's inner-table creation waited 2.6 s on it, so the `CREATE MATERIALIZED VIEW ... POPULATE` writer queued only after the flush already held its share lock. The writer's 10 s `lock_acquire_timeout` expired with `DEADLOCK_AVOIDED`, naming the flush as the owner; the flush itself finished 2.2 s later, so this is not the deadlock case 6 pins. Storage is incidental to case 6, which pins an RWLock ordering between the INSERT's share lock, a queued writer and the flush. Pin the source table and the view's inner table to `storage_policy = 'default'` (local disk on every lane), so neither the flush's part write nor the writer's inner-table creation goes through the cache. The scenario and the 10 s budget are unchanged. 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 over 2 runs) plus my own review of the diff (0 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261024-210700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261024-203400 |
|
cc @Felixoid, could you review this and add the |
|
Workflow [PR], commit [f49651c] Summary: ✅ AI ReviewSummaryThe change pins both case 6 tables in Final VerdictStatus: ✅ Approve |
15c433e
Related: #111663
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Case 6 of the
04633_async_insert_select_alter_racetest now keeps its tables on the local disk, so a filesystem cache can no longer push its view creation past the lock timeout.Description
04633_async_insert_select_alter_racefailed twice inStateless tests (arm_asan_ubsan, azure, parallel)(1,
2):
case 6's
CREATE MATERIALIZED VIEW ... POPULATEhit its 10 slock_acquire_timeoutwithDEADLOCK_AVOIDED.The owner it names is the async insert flush of the case's own
INSERT, and it was slow, not stuck. On the azurelane the default
MergeTreepolicy is a write-through filesystem cache. In job 1 the flush held the table share lockfor 13.3 s, 13.1 s of it in
FilesystemCachePriorityWriteLockMicroseconds(each Azure upload took about 1 ms), andfinished 2.2 s after the writer gave up. The view's inner table creation also waited 2.6 s on that lock, so the
writer queued after the flush took its share lock instead of during the
SELECT, the ordering case 6 exists to test.Storage is incidental to case 6, so the source table and the view's inner table now use
storage_policy = 'default'. The scenario and the 10 s budget are unchanged.Validation on a local write-through cache rig, with
file_cache_pause_before_do_evictionpausing the cache: forcingthe writer in after the flush reproduces the CI error 2/2 on the old test, with the stalled flush as the owner; with
the new tables the flush never touches the cache and the view is created in 0.2 s, 2/2. Without a failpoint the old
flush makes 22 cache reservations and the new one none. 100/100 randomized runs pass on two rigs.
No related issue is open.
Workflow [PR]
Sync PR [sync-upstream/pr/127751]
Version info
26.11.1.759-master(included in26.11and later)