Forbid cleaning of tmp directories that can be used by an active mutation/merge.#28760
Conversation
Only happens if no files were written during |
Yes, but:
|
5092e39 to
321e847
Compare
Unrelated, but interesting, sure right now there are no such nodes ( |
321e847 to
be8d84f
Compare
Looks like should be fixed by #29061, in particular https://github.com/ClickHouse/ClickHouse/pull/29061/files#diff-27b2fdac05cd0b4e165bebc7509be60eaeb37a260ffb35cc69f5614e3f81c3d8R223-R228 (since |
|
@alexey-milovidov can you do a final look please? |
Fixed in #29061 (and it is already merged, anyway this PR should not be related to the failure of |
be8d84f to
20bdda6
Compare
Rebased to fix conflicts. |
Let me know if conflicts should be resolved for review. |
20bdda6 to
405d537
Compare
…merge/mutation v2: rebase against MergeTask v3: rebase due to conflicts in src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp v4: - rebase due to conflicts in src/Storages/MergeTree/MergeTask.cpp - drop common/scope_guard_safe.h (not used)
405d537 to
07e8b2b
Compare
|
In ClickHouse#33291 final part commit had been defered, and now it can take significantly more time, that may lead to "Part directory doesn't exist" error during INSERT: 2022.02.21 18:18:06.979881 [ 11329 ] {insert} <Debug> executeQuery: (from 127.1:24572, user: default) INSERT INTO db.table (...) VALUES 2022.02.21 20:58:03.933593 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18044_18044_0 to 20220214_270654_270654_0. 2022.02.21 21:16:50.961917 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18197_18197_0 to 20220214_270689_270689_0. ... 2022.02.22 21:16:57.632221 [ 64878 ] {} <Warning> db.table: Removing temporary directory /clickhouse/data/db/table/tmp_insert_20220214_18232_18232_0/ ... 2022.02.23 12:23:56.277480 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18232_18232_0 to 20220214_273459_273459_0. 2022.02.23 12:23:56.299218 [ 11329 ] {insert} <Error> executeQuery: Code: 107. DB::Exception: Part directory /clickhouse/data/db/table/tmp_insert_20220214_18232_18232_0/ doesn't exist. Most likely it is a logical error. (FILE_DOESNT_EXIST) (version 22.2.1.1) (from 127.1:24572) (in query: INSERT INTO db.table (...) VALUES), Stack trace (when copying this message, always include the lines below): Follow-up for: ClickHouse#28760 Refs: ClickHouse#33291 Signed-off-by: Azat Khuzhin <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Forbid cleaning of tmp directories that can be used by an active mutation/merge.
Detailed description / Documentation draft:
Mutator cannot be run in parallel with cleaner,
since cleaner may remove partial result of a merge,
and chances of this will be increase if:
And these will lead to missing columns in these part,
and the server will figure out that something is wrong only on DETACH/ATTACH.
NOTE: tested manually