add locks

This commit is contained in:
proller 2017-11-01 22:56:07 +03:00
parent 3b58e9cd67
commit 6da4f5a661
2 changed files with 2 additions and 0 deletions

View File

@ -1748,6 +1748,7 @@ void MergeTreeData::calculateColumnSizesImpl()
void MergeTreeData::addPartContributionToColumnSizes(const DataPartPtr & part)
{
std::shared_lock<std::shared_mutex> lock(part->columns_lock);
const auto & files = part->checksums.files;
/// TODO This method doesn't take into account columns with multiple files.

View File

@ -310,6 +310,7 @@ bool ReplicatedMergeTreeQueue::pullLogsToQueue(zkutil::ZooKeeperPtr zookeeper, z
const auto & entry = *copied_entries.back();
if (entry.type == LogEntry::GET_PART)
{
std::lock_guard<std::mutex> lock(mutex);
if (entry.create_time && (!min_unprocessed_insert_time || entry.create_time < min_unprocessed_insert_time))
{
min_unprocessed_insert_time = entry.create_time;