Repository navigation
Make 04330_rocksdb_truncate_drop_null_ptr stress-restart safe - #107858
hanfei1991 merged 2 commits into
Conversation
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-0:20260618-124400 |
|
cc @rschu1ze — could you review this? Test-only follow-up to #106940: it rewrites the EmbeddedRocksDB null-ptr regression test to run in a one-shot |
|
I am not affiliated with EmbeddedRockDB, sorry. |
|
cc @hanfei1991 — you reviewed and approved the parent fix #106940; could you take this test-only follow-up? It rewrites that EmbeddedRocksDB null-ptr regression test to run in a one-shot |
|
Workflow [PR], commit [9d052a4] Summary: ❌
AI ReviewSummaryThis PR rewrites Final VerdictStatus: ✅ Approve |
The regression test for the EmbeddedRocksDB truncate()/drop() null-handle fix (merged in ClickHouse#106940) created a persistent read_only table over a relative user_files directory and TRUNCATEd it. A stress-test server restart then re-attached that poisoned read_only table whose data dir had been wiped, so the server refused to start (ROCKSDB_ERROR, "Cannot start clickhouse-server"). Run the whole scenario inside a single one-shot clickhouse-local process so the poisoned read_only table never persists into server metadata, and place the data dir under CLICKHOUSE_TMP with a unique name so parallel runs never collide (drops the no-parallel tag). A SELECT count() over the read_only table runs before the first TRUNCATE and must print 1: it proves the table actually opened over the data the rw table persisted (the EmbeddedRocksDB read_only path was reached) rather than --ignore-error silently swallowing a broken setup, so the trailing 'ok' only appears when the null-handle path was genuinely exercised. Co-Authored-By: Claude Opus 4.8 <[email protected]>
28c8f91 to
d7f3d44
Compare
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-2:20260618-142900 |
|
CI finished on d7f3d44. This PR only edits the unrelated
The rocksdb test itself passes (debug, asan, msan, tsan flaky-check all green). Ready for review. |
|
@groeneai can you fix 00653_verification_monotonic_data_load? |
|
@hanfei1991 The 00653 crash is a trunk heap-corruption bug, not caused by this PR (it only edits the unrelated 04330 rocksdb test). It is a 3-frame jump-to-NULL SIGSEGV during I believe it is already fixed on master by #107457 (COW-safe The crash was only ever 2 hits, both on 2026-06-18 and both before #107457 merged (master |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 214 line(s), 37 function(s) across 90 file(s) · Details Top files
|
1508215
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Test-only follow-up to #106940 (the EmbeddedRocksDB
truncate()/drop()null-pointer fix), which is already merged.The regression test
04330_rocksdb_truncate_drop_null_ptr.shcreated aread_onlyEmbeddedRocksDB table over a relativeuser_filesdirectory on the running server and emptied it withTRUNCATE. That left a persistedread_onlytable whose data directory was wiped. When the Stress test restarted the server mid-run, attaching that table calledOpenForReadOnly()on the missing directory, which threwROCKSDB_ERRORand aborted metadata loading, so the server refused to start.Master regression:
Cannot start clickhouse-server,Stress test (amd_debug), commit81a39f72bed5c9f6798b86d8403f3a2e23dbfc91Code: 555 ... Failed to open rocksdb path at: /var/lib/clickhouse/user_files/04330_rocksdb_test_1: IO error: No such file or directory: While opening .../CURRENT ... Cannot attach table test_1.rdb_roFix: run the whole scenario in a single
clickhouse-localprocess. The poisonedread_onlytable lives only for that one-shot process and is never written to server metadata, so a stress restart can no longer reattach it.--ignore-errorlets the batch continue past the firstTRUNCATE's expected reopen failure so the secondTRUNCATEand theDROPstill execute against the now-null handle, which is exactly the path the merged fix guards. The data directory is placed underCLICKHOUSE_TMPwith a unique per-test name, so the test is parallel-safe and no longer needsno-parallel.The merged C++ fix is unchanged. Verified locally (debug build) both directions: without the guards the
clickhouse-localprocess segfaults (nook, output mismatches the reference); with the guards it printsok. The test runs in the parallel pool (clickhouse-testreports it as a parallel test) and passes repeatedly.Version info
26.6.1.1119