dbms: attempt to fix an error (incomplete) [#METR-17286].

This commit is contained in:
Alexey Milovidov 2015-09-18 00:31:26 +03:00
parent 10b86afd3c
commit 7a7a2ac6e0

View File

@ -379,13 +379,24 @@ void MergeTreeData::setPath(const String & new_full_path, bool move_data)
void MergeTreeData::dropAllData() void MergeTreeData::dropAllData()
{ {
LOG_TRACE(log, "dropAllData: waiting for locks.");
Poco::ScopedLock<Poco::FastMutex> lock(data_parts_mutex);
Poco::ScopedLock<Poco::FastMutex> lock_all(all_data_parts_mutex);
LOG_TRACE(log, "dropAllData: removing data from memory.");
data_parts.clear(); data_parts.clear();
all_data_parts.clear(); all_data_parts.clear();
column_sizes.clear(); column_sizes.clear();
context.resetCaches(); context.resetCaches();
LOG_TRACE(log, "dropAllData: removing data from filesystem.");
Poco::File(full_path).remove(true); Poco::File(full_path).remove(true);
LOG_TRACE(log, "dropAllData: done.");
} }