Skip to content

Commit

Permalink
Fix data race of DeltaIndexManager. (#4459) (#4773)
Browse files Browse the repository at this point in the history
close #4405
  • Loading branch information
ti-chi-bot authored Jun 16, 2022
1 parent 59cd046 commit a4b37d1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ void DeltaIndexManager::refreshRef(const DeltaIndexPtr & index)
current_size += holder.size;

removeOverflow(removed);
CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size);
}

CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size);
}

void DeltaIndexManager::deleteRef(const DeltaIndexPtr & index)
Expand Down Expand Up @@ -111,9 +110,8 @@ void DeltaIndexManager::deleteRef(const DeltaIndexPtr & index)
lru_queue.erase(holder.queue_it);
// Remove it later
index_map.erase(it);
CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size);
}

CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size);
}

DeltaIndexPtr DeltaIndexManager::getRef(UInt64 index_id)
Expand Down

0 comments on commit a4b37d1

Please sign in to comment.