Skip to content

Commit

Permalink
fix: [cp]Change deltalog memory estimation fator to one
Browse files Browse the repository at this point in the history
See also: milvus-io#36031
pr: milvus-io#36033

Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn committed Sep 6, 2024
1 parent cd68e9f commit 3c0070e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/querynodev2/segments/segment_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,18 @@ func getResourceUsageEstimateOfSegment(schema *schemapb.CollectionSchema, loadIn

// get size of delete data
for _, fieldBinlog := range loadInfo.Deltalogs {
segmentMemorySize += uint64(float64(getBinlogDataMemorySize(fieldBinlog)) * multiplyFactor.deltaDataExpansionFactor)
// MemorySize of filedBinlog is the actual size in memory, so the expansionFactor
// should be 1, in most cases.
expansionFactor := float64(1)
memSize := getBinlogDataMemorySize(fieldBinlog)

// Note: If MemorySize == DiskSize, it means the segment comes from Milvus 2.3,
// MemorySize is actually compressed DiskSize of deltalog, so we'll fallback to use
// deltaExpansionFactor to compromise the compression ratio.
if memSize == getBinlogDataDiskSize(fieldBinlog) {
expansionFactor = multiplyFactor.deltaDataExpansionFactor
}
segmentMemorySize += uint64(float64(memSize) * expansionFactor)
}
return &ResourceUsage{
MemorySize: segmentMemorySize + indexMemorySize,
Expand Down

0 comments on commit 3c0070e

Please sign in to comment.