This commit is contained in:
kssenii 2023-08-12 15:00:32 +04:00
parent c73b496da5
commit f4562d19a1
2 changed files with 4 additions and 4 deletions

View File

@ -283,7 +283,7 @@ void CacheMetadata::removeKey(const Key & key, bool if_exists, bool if_releasabl
if (if_exists) if (if_exists)
return; return;
else 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(); 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) if (if_exists)
return; return;
else 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); bool removed_all = locked_key->removeAllFileSegments(if_releasable);

View File

@ -121,8 +121,8 @@ public:
KeyNotFoundPolicy key_not_found_policy, KeyNotFoundPolicy key_not_found_policy,
bool is_initial_load = false); bool is_initial_load = false);
void removeKey(const Key & key, bool if_exists, bool is_releasable); void removeKey(const Key & key, bool if_exists, bool if_releasable);
void removeAllKeys(bool is_releasable); void removeAllKeys(bool if_releasable);
void cancelCleanup(); void cancelCleanup();