fix: merge sort segment loss data (#37400)

relate: https://github.com/milvus-io/milvus/issues/37238

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2024-11-07 11:18:26 +08:00 committed by GitHub
parent 51ed2a61c8
commit b4c749dcd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,6 +105,12 @@ func mergeSortMultipleSegments(ctx context.Context,
deletedRowCount++
continue
}
// Filtering expired entity
if isExpiredEntity(collectionTtl, currentTs, typeutil.Timestamp(v.Timestamp)) {
expiredRowCount++
continue
}
return v, nil
}
}
@ -125,12 +131,6 @@ func mergeSortMultipleSegments(ctx context.Context,
smallest := heap.Pop(&pq).(*PQItem)
v := smallest.Value
// Filtering expired entity
if isExpiredEntity(collectionTtl, currentTs, typeutil.Timestamp(v.Timestamp)) {
expiredRowCount++
continue
}
err := mWriter.Write(v)
if err != nil {
log.Warn("compact wrong, failed to writer row", zap.Error(err))