You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Garbage on FS after replicated merge tree table creation with invalid zk path #33710
Garbage on a filesystem after error with invalid zk path, you can't create a table with fixed path due to Directory for table data data/test_db/test_table/ already exists. error.
A clear and concise description of what works not as it is supposed to.
Create Ordinary database(issue less significant on Atomic engine, because it generates new uid on retry)
Create ReplicatedMergeTree table with invalid zk path(i.e. without leading / CREATE TABLE test_db.test_table (id String) ENGINE = ReplicatedMergeTree('default.test_table', '{replica}') ORDER BY id SETTINGS index_granularity = 8192, get error DB::Exception: ZooKeeper path must starts with '/', got 'default.test_table'
Retry query(possibly with fixed zk path), get error DB::Exception: Directory for table data data/test_db/test_table/ already exists.
Expected behavior
The failed table should not create garbage on fs.
Expected behavior
The failed table should not create garbage on fs.
Applicable for Atomic databases as well. It's just don't lead to errors "table already exists" on retry.
For Atomic databases it's fixed in #38265. And for Ordinary databases it will not be fixed, because it's almost impossible to fix it for Ordinary engine because of its design flaws.
Hi @tavplubix , the implementation of #39872 causes performance issue when I have a lot of s3_plain disks and dropping a lot of tables (about 100x slower). Is there any possibility to only drop the stores on the disks of the database of the table instead of all the disks?
2024.09.25 07:47:59.679453 [ 738891 ] {} <Information> DatabaseCatalog: Have 330562 tables in drop queue (0 of them are in use), will try drop XXX.YYY (7b875319-c250-44ae-b878-9c3960ff87a9)
...
2024.09.25 07:47:59.688182 [ 738891 ] {} <Trace> XXX.YYY (7b875319-c250-44ae-b878-9c3960ff87a9): dropAllData: done.
2024.09.25 07:48:00.361572 [ 738891 ] {} <Information> AWSClient: Failed to make request to: https://storage.googleapis.com/BUCKET?list-type=2&max-keys=1&prefix=ZZZ%2Fstore%2F7b8%2F7b875319-c250-44ae-b878-9c3960ff87a9%2F: Poco::Exception. Code: 1000, e.code() = 0, Timeout, Stack trace (when copying this message, always include the lines below):
2024.09.25 07:48:01.033525 [ 738891 ] {} <Information> AWSClient: Failed to make request to: https://storage.googleapis.com/BUCKET?list-type=2&max-keys=1&prefix=AAA%2Fstore%2F7b8%2F7b875319-c250-44ae-b878-9c3960ff87a9%2F: Poco::Exception. Code: 1000, e.code() = 0, Timeout, Stack trace (when copying this message, always include the lines below):
2024.09.25 07:48:01.033990 [ 738891 ] {} <Information> AWSClient: Failed to make request to: https://storage.googleapis.com/BUCKET?list-type=2&max-keys=1&prefix=BBB%2Fstore%2F7b8%2F7b875319-c250-44ae-b878-9c3960ff87a9%2F: Poco::Exception. Code: 1000, e.code() = 101, Net Exception: Network is unreachable, Stack trace (when copying this message, always include the lines below):
2024.09.25 07:48:02.130098 [ 738891 ] {} <Information> DatabaseCatalog: Removing metadata /srv/clickhouse/metadata_dropped/XXX.YYY.7b875319-c250-44ae-b878-9c3960ff87a9.sql of dropped table XXX.YYY (7b875319-c250-44ae-b878-9c3960ff87a9)
Activity
alexey-milovidov commentedon Jan 17, 2022
This issue has very low priority because it does not happen with Atomic databases, that are by default.
Alex-Burmak commentedon Jan 20, 2022
Applicable for Atomic databases as well. It's just don't lead to errors "table already exists" on retry.
den-crane commentedon Jan 24, 2022
wa (removal of garbage folder):
tavplubix commentedon Jun 21, 2022
For Atomic databases it's fixed in #38265. And for Ordinary databases it will not be fixed, because it's almost impossible to fix it for Ordinary engine because of its design flaws.
spff commentedon Sep 27, 2024
Hi @tavplubix , the implementation of #39872 causes performance issue when I have a lot of s3_plain disks and dropping a lot of tables (about 100x slower). Is there any possibility to only drop the stores on the disks of the database of the table instead of all the disks?
alexey-milovidov commentedon Nov 22, 2026
I agree. The implementation is more harmful than what it provides. Will revert.
alexey-milovidov commentedon Nov 22, 2026
The real crime is not providing comments in the code: https://github.com/ClickHouse/ClickHouse/blame/16b17eb281fa6c1d3798d8287b94b80ac9cc783d/src/Interpreters/DatabaseCatalog.h#L348