fix: Fix sorting buffer in clustering compaction (#38417)

issue: #28410

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2024-12-13 10:12:49 +08:00 committed by GitHub
parent e404123e3e
commit 6ffc57c8dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -857,7 +857,7 @@ func (t *clusteringCompactionTask) flushLargestBuffers(ctx context.Context) erro
t.clusterBufferLocks.RUnlock(buffer.id)
}
sort.Slice(bufferIDs, func(i, j int) bool {
return bufferRowNums[i] > bufferRowNums[j]
return bufferRowNums[bufferIDs[i]] > bufferRowNums[bufferIDs[j]]
})
log.Info("start flushLargestBuffers", zap.Ints("bufferIDs", bufferIDs), zap.Int64("currentMemorySize", currentMemorySize))