Skip to content

Conversation

@alex-zaitsev
Copy link
Member

sunsingerus and others added 28 commits September 23, 2025 18:47
#1820)

When multiple disks are combined into a single volume and the default disk(not in the volume, just includes metadata) becomes lost, the ClickHouse operator attempts to recover the tables.
However, because the actual table data still exists intact on other disks (not on the lost default disk), ClickHouse throws the following error during the CREATE TABLE operation, and the table fails to recover properly:

```sh
<Error> executeQuery: Code: 117. DB::Exception: Data directory for table already contains data parts - probably it was unclean DROP table or manual intervention. You must either clear directory by hand or use ATTACH TABLE instead of CREATE TABLE if you need to use that parts. (INCORRECT_DATA) (version 25.6.3.116 (official build))
```

In this situation, the issue can be resolved by using the ATTACH TABLE command instead.

Since there is already existing logic that falls back to ATTACH TABLE for other error codes, we only need to add specific handling for error code 117.

Signed-off-by: thomas.e <[email protected]>
Co-authored-by: thomas.e <[email protected]>
Signed-off-by: Saeed Hosseini [email protected]

Signed-off-by: Saeed Hosseini [email protected]
@sunsingerus sunsingerus merged commit 2270e45 into master Sep 26, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.