mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
fix datarace in stress test in storagemergetree
This commit is contained in:
parent
fe5df2c1ed
commit
0e9cad2276
@ -1222,13 +1222,14 @@ void StorageMergeTree::movePartitionToTable(const StoragePtr & dest_table, const
|
||||
{
|
||||
Transaction transaction(*dest_table_storage);
|
||||
|
||||
auto data_parts_lock = lockParts();
|
||||
auto src_data_parts_lock = lockParts();
|
||||
auto dest_data_parts_lock = dest_table_storage->lockParts();
|
||||
|
||||
for (MutableDataPartPtr & part : dst_parts)
|
||||
dest_table_storage->renameTempPartAndReplace(part, &increment, &transaction, data_parts_lock);
|
||||
dest_table_storage->renameTempPartAndReplace(part, &increment, &transaction, dest_data_parts_lock);
|
||||
|
||||
transaction.commit(&data_parts_lock);
|
||||
removePartsFromWorkingSet(src_parts, true, data_parts_lock);
|
||||
transaction.commit(&src_data_parts_lock);
|
||||
removePartsFromWorkingSet(src_parts, true, src_data_parts_lock);
|
||||
}
|
||||
|
||||
clearOldMutations(true);
|
||||
|
Loading…
Reference in New Issue
Block a user