Repository navigation
Conversation
|
Workflow [PR], commit [1b6710e] Summary: ❌
AI ReviewSummaryThis PR adds Findings
💡 Nits
Tests
Final VerdictStatus: Minimum required action: fix the |
|
The issue for this task is #105018. More commands will be added in follow-up PRs. |
| @@ -0,0 +1,58 @@ | |||
| #!/usr/bin/env bash | |||
| # Tags: no-fasttest | |||
There was a problem hiding this comment.
This excludes the only new wc coverage from Fast test, while the adjacent du test uses the same local object_storage clickhouse-disks harness without no-fasttest. Repository policy is to avoid no-* tags unless they are strictly necessary; keeping this tag means regressions in the new command can pass the faster gating. Please remove it, or add a concrete reason if this test really cannot run in Fast test.
DatabaseCatalog::addUUIDMapping(uuid, db, table) threw a LOGICAL_ERROR when
the UUID was already mapped to a live table. During ATTACH DATABASE (and
server startup) tables are loaded via attachTable, which calls addUUIDMapping
directly with a real (database, table) pair and bypasses the empty "lock"
reservation. If two table metadata files in the loaded database declare the
same explicit UUID, the second table reaches that throw and the LOGICAL_ERROR
aborts the whole server in debug/sanitizer builds.
Two table .sql files sharing one UUID is user-controlled, external on-disk
state: it can be produced by manual edits, or by a leftover _tmp_replace_*
table from CREATE OR REPLACE TABLE ... UUID '...' that carries the same
explicit UUID as the live target table. That is a user error, not an internal
invariant violation, and the sibling branch already reports the same condition
as a non-fatal TABLE_ALREADY_EXISTS ("UUID collision, most likely because some
not random UUIDs were manually specified"). The runtime ATTACH TABLE path even
hits that friendly error today; only the load path aborts.
Report the collision as TABLE_ALREADY_EXISTS instead of LOGICAL_ERROR. The
conflicting table fails to load with a clear message, the rest of the database
attaches, and the server stays up. This covers both the ATTACH DATABASE async
load path and the server startup path.
Found by BuzzHouse (amd_tsan) on PR ClickHouse#105020 (STID 3178-4166); the family also
hit PRs ClickHouse#100047, ClickHouse#106268, ClickHouse#100703 (STID 3178-4504). New test
04340_attach_database_duplicate_uuid_no_crash reproduces the crash
deterministically and verifies the server survives.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 94/99 (94.95%) | Lost baseline coverage: none · Uncovered code |
| } | ||
| } |
There was a problem hiding this comment.
this continue now is not needed
|
Hi @asya-ch @Michicosun — a couple of suggestions to make this PR easier for reviewers and the changelog reader. Description (currently
Ignore this if the current title/body is intentional. |
Add du and wc commands to clickhouse-disks
Changelog category (leave one):
Changelog entry (a [user-readable short description]):
Add du and wc commands to clickhouse-disks. They, respectively, (a) print the total size in bytes for a given file or directory, and (b) list the number of bytes, lines, and words in a file.
Version info
26.7.1.80