Skip to content

Commit

Permalink
fix: Fix data race for clustering compaction writer (milvus-io#35957)
Browse files Browse the repository at this point in the history
issue: milvus-io#35950

Signed-off-by: Cai Zhang <[email protected]>
  • Loading branch information
xiaocai2333 authored Sep 4, 2024
1 parent 6eb8b3f commit 90bdb17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/datanode/compaction/clustering_compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ func (t *clusteringCompactionTask) mapping(ctx context.Context,
func (t *clusteringCompactionTask) getBufferTotalUsedMemorySize() int64 {
var totalBufferSize int64 = 0
for _, buffer := range t.clusterBuffers {
t.clusterBufferLocks.Lock(buffer.id)
totalBufferSize = totalBufferSize + int64(buffer.writer.WrittenMemorySize()) + buffer.bufferMemorySize.Load()
t.clusterBufferLocks.Unlock(buffer.id)
}
return totalBufferSize
}
Expand Down

0 comments on commit 90bdb17

Please sign in to comment.