[ 169492 ] {} <Error> Application: DB::Exception: Suspiciously many (1416 parts, 0.00 B in total) broken parts to remove while maximum allowed broken parts count is 100. You can change the maximum value with merge tree setting 'max_suspicious_broken_parts' in <merge_tree> configuration section or in table settings in .sql file (don't forget to return setting back to default value): Cannot attach table `xxx` from metadata file /xxx/clickhouse/store/471/4714bfe1-4aae-41c5-90dd-fc116041c0f1/xxx.sql from query ATTACH TABLE xxx UUID '52ee5ee1-3bf6-4a16-b89e-81b78e91de90' (`client` UInt32, ...) ENGINE = MergeTree PRIMARY KEY client ORDER BY client SETTINGS index_granularity = 8192
報錯日誌也說的很清楚了,因爲文件損壞,默認可以修復的是100個,但是現在有1416個,超過了限制。可以在配置文件中增加也可以在損壞的數據庫sql中增加。數據庫sql的位置也給定了/xxx/clickhouse/store/471/4714bfe1-4aae-41c5-90dd-fc116041c0f1/xxx.sql
在sql最後SETTINGS後面增加一個設置SETTINGS index_granularity = 8192,max_suspicious_broken_parts=2000
把限制設置的大於損壞的part個數即可