Skip to content

Wait for the table to load before arming the failpoint in test 05292_part_log_remove_part_on_retried_drop_table - #129699

Merged
murphy-4o merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05292-wait-table-load-before-failpoint
Nov 6, 2026
Merged

murphy-4o merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05292-wait-table-load-before-failpoint

Conversation

@groeneai

@groeneai groeneai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #116042

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The test 05292_part_log_remove_part_on_retried_drop_table now waits for its table to finish loading before it arms the failpoint, so the table load can no longer consume it.

Description

The test failed twice in Stateless tests (arm_binary, parallel) (1, 2) with Load job 'load table d.t' failed: ... disk_object_storage_fail_commit_metadata_transaction ... (FAULT_INJECTED),. (ASYNC_LOAD_WAIT_FAILED). Both failures came after #116042; there were 0 failures in 116k runs before it.

Since #116042, clickhouse-local loads persisted tables in the background, and a query waits only for the tables it uses. The second clickhouse-local of the test arms the ONCE failpoint as its first statement, which does not use d.t. When load table d.t runs after that, attaching the table commits a metadata transaction on the local_blob_storage disk (DiskObjectStorage::createDirectories). That consumes the failpoint, the load fails, and DROP TABLE d.t SYNC throws ASYNC_LOAD_WAIT_FAILED.

The fix adds SYSTEM WAIT LOADING PARTS d.t before arming the failpoint. It waits for the table's load and startup jobs and prints nothing, so the .reference is unchanged. The DROP's part removal is again the first metadata commit after the arm.

Validation, master debug binary:

  • Deterministic repro (3000 filler tables, tables_loader_background_pool_size = 1): the current test fails 9/10 with the CI error, and every failing run saw load table d.t still PENDING when the failpoint was armed. With the fix: 10/10 pass.
  • tests/clickhouse-test, randomized: 50/50 and 300/300 (-j 32) pass with the fix, and 16/50 fail without it.

Workflow [PR]
Sync PR [sync-upstream/pr/129699]

Version info

  • Merged into: 26.11.1.1511-master (included in 26.11 and later)

…log_remove_part_on_retried_drop_table

Since ClickHouse#116042 clickhouse-local loads persisted tables asynchronously, and a
query waits only for the tables it uses. The second clickhouse-local of the
test arms the ONCE failpoint disk_object_storage_fail_commit_metadata_transaction
as its first statement, which does not use d.t. When the background job
'load table d.t' runs after the arm, the attach commits a metadata transaction
on the local_blob_storage disk (DiskObjectStorage::createDirectories), consumes
the failpoint and fails with FAULT_INJECTED; DROP TABLE d.t SYNC then waits on
the failed load and throws ASYNC_LOAD_WAIT_FAILED (seen twice in
Stateless tests (arm_binary, parallel), PRs 125006 and 129676).

SYSTEM WAIT LOADING PARTS d.t resolves the table through
DatabaseCatalog::getTable -> waitTableStarted, which waits for the load and
startup jobs, so the DROP's part removal is again the first metadata commit
after the arm. It prints nothing; the reference is unchanged.

Validation on a master debug binary: with 3000 filler tables and
tables_loader_background_pool_size = 1 the old test fails 9/10 (load still
PENDING at the arm in every failing run), the fixed one passes 10/10;
tests/clickhouse-test with random settings: 16/50 fail before, 50/50 and
300/300 pass after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review: my own cold review plus an independent model (engine: codex); 0 findings from either.

I traced the added statement: SYSTEM WAIT LOADING PARTS d.t resolves the table through DatabaseCatalog::getTable, which waits for the startup table d.t task (it depends on load table d.t) before returning. Only after that is the ONCE failpoint armed, so the DROP's part removal is the first metadata commit on the object-storage disk after the arm.

Severity: ❌ blocker / ⚠️ major / 💡 nit. No rows.

Session id: cron:clickhouse-review-slot-8:20261106-084600

@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [33d32b9]

Summary: ✅


AI Review

Summary

This test-only change waits for d.t to finish loading before arming disk_object_storage_fail_commit_metadata_transaction, preventing asynchronous attachment from consuming the one-shot failpoint. No actionable findings. The original failure and per-part RemovePart assertions remain intact, and the changed test passed in the PR's Fast test job.

Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors pr-ci labels Nov 6, 2026
@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With 3000 filler tables and tables_loader_background_pool_size = 1, the current test fails 9/10 with the CI error. Every failing run saw load table d.t still PENDING in system.asynchronous_loader when the failpoint was armed; the one passing run saw OK.
b Root cause explained? Yes. Since #116042, clickhouse-local loads persisted tables in the background. The ONCE failpoint is armed before d.t is loaded, the attach commits a metadata transaction on the local_blob_storage disk and consumes it, and DROP TABLE d.t SYNC then waits on the failed load and throws ASYNC_LOAD_WAIT_FAILED.
c Fix matches root cause? Yes. SYSTEM WAIT LOADING PARTS d.t waits for the table's load and startup jobs before the arm, which restores the ordering the test was written for. No retries, tags or setting changes.
d Test intent preserved / new tests added? Yes. The test body and .reference are unchanged: the failpoint still fires during the DROP (system.errors row) and each part still gets exactly one RemovePart.
e Both directions demonstrated? Yes. Repro: 9/10 fail without the fix, 10/10 pass with it. tests/clickhouse-test with random settings: 16/50 fail without the fix, 50/50 and 300/300 (-j 32) pass with it.
f Fix is general across code paths? N/A (test-only). Of the .sh tests that combine clickhouse-local with a failpoint, only this one reopens a persisted --path holding a table on an object-storage disk.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only ordering fix).
h Backward compatible? (maintainer-approved exception only) Yes. No product code, settings or formats changed.
i Invariants and contracts preserved? Yes. Between the arm and the DROP's part removal nothing else commits a disk metadata transaction: the table's load and startup finish before the arm, the system database is on the default local disk, and no merges can run (one part per partition).

Session id: cron:clickhouse-impl-slot-4:20261106-083100

@groeneai

groeneai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

cc @murphy-4o, could you review this? Since #116042 clickhouse-local loads d.t in the background, so the test's ONCE failpoint could be consumed by the table's own attach instead of the DROP; the test now runs SYSTEM WAIT LOADING PARTS d.t before arming it.

@murphy-4o
murphy-4o enabled auto-merge November 6, 2026 09:15
@murphy-4o murphy-4o self-assigned this Nov 6, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 6, 2026
@murphy-4o
murphy-4o added this pull request to the merge queue Nov 6, 2026
Merged via the queue into ClickHouse:master with commit 0c67c32 Nov 6, 2026
186 of 187 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 6, 2026
@clickhouse-gh clickhouse-gh Bot added comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants