Commit d6335e4
Try attach table if INCORRECT_DATA(error code 117) with "CREATE TABLE" (#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 <thomas.e@kakaocorp.com>
Co-authored-by: thomas.e <thomas.e@kakaocorp.com>1 parent e87bdf5 commit d6335e4
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
| |||
0 commit comments