-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable updating fs cache during backup/restore. #52402
Disable updating fs cache during backup/restore. #52402
Conversation
This is an automated comment for commit 587877d with description of existing statuses. It's updated for the latest CI running
|
src/Backups/BackupsWorker.cpp
Outdated
read_settings.enable_filesystem_cache = false; | ||
read_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache = backup_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting read_from_filesystem_cache_if_exists_otherwise_bypass_cache
will not work if enable_filesystem_cache
is disabled, see
ClickHouse/src/Disks/IO/ReadBufferFromRemoteFSGather.cpp
Lines 21 to 23 in 5ea0971
return settings.remote_fs_cache && settings.enable_filesystem_cache | |
&& (!CurrentThread::getQueryId().empty() || settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache | |
|| !settings.avoid_readthrough_cache_outside_query_context); |
may be better something like this?
read_settings.enable_filesystem_cache = backup_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache;
read_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache = backup_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache;
read_settings.avoid_readthrough_cache_outside_query_context = false; /// not sure if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
avoid_readthrough_cache_outside_query_context
doesn't seem necessary because though BACKUP/RESTORE can operate in background they always have proper query id. Anyway the tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also may be add a test?
a7c0417
to
11cdb8c
Compare
I added test. |
a4812fa
to
574eac8
Compare
…e_bypass_cache" -> "read_from_filesystem_cache".
6cd1a9f
to
6ac61b1
Compare
Changelog category:
Changelog entry:
Disable updating fs cache during backup/restore. Filesystem cache must not be updated during backup/restore, it seems it just slows down the process without any profit (because the BACKUP command can read a lot of data and it's no use to put all the data to the filesystem cache and immediately evict it).