Skip to content

Commit

Permalink
Fix data race of DeltaIndexManager. (#4459) (#4472)
Browse files Browse the repository at this point in the history
close #4405
  • Loading branch information
ti-chi-bot authored Mar 28, 2022
1 parent 5aea73d commit 066f1b7
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 @@ -92,9 +92,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 @@ -124,9 +123,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 066f1b7

Please sign in to comment.