Fix race between DROP DATABASE and cleanup thread#83733
Closed
azat wants to merge 1 commit intoClickHouse:masterfrom
Closed
Fix race between DROP DATABASE and cleanup thread#83733azat wants to merge 1 commit intoClickHouse:masterfrom
azat wants to merge 1 commit intoClickHouse:masterfrom
Conversation
In case of database_catalog_unused_dir_hide_timeout_sec=0 it is possible
that cleanup thread will set the permissions to 0, and unlink will fail,
like here [1]:
2025.07.14 18:54:19.462907 [ 504837 ] {} <Information> DatabaseCatalog: Removing data directory store/000/00000000-0000-0000-0000-000000000001/ of dropped table test_l14n5q09.no_insertable (00000000-0000-0000-0000-000000000001) from disk default
2025.07.14 18:54:19.462975 [ 472719 ] {6654b89c-041d-4254-89fb-e1ad1ae031c5} <Debug> DatabaseCatalog: Waiting for table 00000000-0000-0000-0000-000000000001 to be finally dropped
2025.07.14 18:54:19.468710 [ 504837 ] {} <Error> DatabaseCatalog: Cannot drop table test_l14n5q09.no_insertable (00000000-0000-0000-0000-000000000001). Will retry later.: std::exception. Code: 1001, type: std::__1::filesystem::filesystem_error, e.what() = filesystem error: in remove_all: Permission denied ["/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/ci/tmp/run_r0/store/000/00000000-0000-0000-0000-000000000001/"], Stack trace (when copying this message, always include the lines below):
[1]: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=83727&sha=f3e974985d16b8abbd8d8843729c8f43b8355d4e&name_0=PR&name_1=Fast%20test
Contributor
evillique
approved these changes
Jul 14, 2025
Member
Member
Author
|
Yes, I will leave a comment there. |
Member
Author
|
Actually I think @tavplubix is right there, and it is enough to avoid UUID collision, I don't like this try/catch anyway, closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case of database_catalog_unused_dir_hide_timeout_sec=0 it is possible that cleanup thread will set the permissions to 0, and unlink will fail, like here 1:
Changelog category (leave one):