Fix locking in UserDefinedSQLObjectsZooKeeperStorage.cpp

This commit is contained in:
Sergei Trifonov 2024-09-01 23:43:05 +02:00 committed by GitHub
parent 44f76ed713
commit fba6620dc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -406,7 +406,7 @@ void UserDefinedSQLObjectsZooKeeperStorage::syncObjects(const zkutil::ZooKeeperP
LOG_DEBUG(log, "Syncing user-defined {} objects", object_type);
Strings object_names = getObjectNamesAndSetWatch(zookeeper, object_type);
getLock();
auto lock = getLock();
/// Remove stale objects
removeAllObjectsExcept(object_names);