diff --git a/src/Interpreters/Cache/Metadata.cpp b/src/Interpreters/Cache/Metadata.cpp index 4d7daeef76b..0dd5a7c4b1b 100644 --- a/src/Interpreters/Cache/Metadata.cpp +++ b/src/Interpreters/Cache/Metadata.cpp @@ -283,7 +283,7 @@ void CacheMetadata::removeKey(const Key & key, bool if_exists, bool if_releasabl if (if_exists) return; else - throw Exception(ErrorCodes::LOGICAL_ERROR, "No such key: {}", key); + throw Exception(ErrorCodes::BAD_ARGUMENTS, "No such key: {}", key); } auto locked_key = it->second->lockNoStateCheck(); @@ -293,7 +293,7 @@ void CacheMetadata::removeKey(const Key & key, bool if_exists, bool if_releasabl if (if_exists) return; else - throw Exception(ErrorCodes::LOGICAL_ERROR, "No such key: {} (state: {})", key, magic_enum::enum_name(state)); + throw Exception(ErrorCodes::BAD_ARGUMENTS, "No such key: {} (state: {})", key, magic_enum::enum_name(state)); } bool removed_all = locked_key->removeAllFileSegments(if_releasable); diff --git a/src/Interpreters/Cache/Metadata.h b/src/Interpreters/Cache/Metadata.h index 9b2f2617f52..e6d360c3027 100644 --- a/src/Interpreters/Cache/Metadata.h +++ b/src/Interpreters/Cache/Metadata.h @@ -121,8 +121,8 @@ public: KeyNotFoundPolicy key_not_found_policy, bool is_initial_load = false); - void removeKey(const Key & key, bool if_exists, bool is_releasable); - void removeAllKeys(bool is_releasable); + void removeKey(const Key & key, bool if_exists, bool if_releasable); + void removeAllKeys(bool if_releasable); void cancelCleanup();