Skip to content

Conversation

@gangseok514
Copy link
Contributor

@gangseok514 gangseok514 commented Sep 19, 2025

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:

<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.

Thanks for taking the time to contribute to clickhouse-operator!

Please, read carefully instructions on how to make a Pull Request.

This will help a lot for maintainers to adopt your Pull Request.

Important items to consider before making a Pull Request

Please check items PR complies to:

  • All commits in the PR are squashed. More info
  • The PR is made into dedicated next-release branch, not into master branch1. More info
  • The PR is signed. More info

--

1 If you feel your PR does not affect any Go-code or any testable functionality (for example, PR contains docs only or supplementary materials), PR can be made into master branch, but it has to be confirmed by project's maintainer.

@Slach Slach changed the base branch from 0.24.0 to 0.25.4 September 19, 2025 09:23
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]>
@gangseok514 gangseok514 force-pushed the fix_create_table_error_with_117 branch from eab1905 to 6ad2c4d Compare September 19, 2025 12:15
@sunsingerus sunsingerus merged commit d6335e4 into Altinity:0.25.4 Sep 23, 2025
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.

3 participants