mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
fix: forbid balancing level zero segments (#29168)
related #29128 Signed-off-by: yah01 <yah2er0ne@outlook.com> --------- Signed-off-by: yah01 <yah2er0ne@outlook.com> Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
parent
f79c6146bd
commit
58dbb7872a
@ -835,6 +835,7 @@ func (s *Server) GetRecoveryInfoV2(ctx context.Context, req *datapb.GetRecoveryI
|
||||
CollectionID: segment.CollectionID,
|
||||
InsertChannel: segment.InsertChannel,
|
||||
NumOfRows: segment.NumOfRows,
|
||||
Level: segment.GetLevel(),
|
||||
})
|
||||
continue
|
||||
}
|
||||
|
@ -273,6 +273,9 @@ func (b *ScoreBasedBalancer) getNormalSegmentPlan(replica *meta.Replica, nodesSe
|
||||
// sort the segments in asc order, try to mitigate to-from-unbalance
|
||||
// TODO: segment infos inside dist manager may change in the process of making balance plan
|
||||
fromSegments := b.dist.SegmentDistManager.GetByCollectionAndNode(replica.CollectionID, fromNode.nodeID)
|
||||
fromSegments = lo.Filter(fromSegments, func(segment *meta.Segment, _ int) bool {
|
||||
return segment.GetLevel() != datapb.SegmentLevel_L0
|
||||
})
|
||||
sort.Slice(fromSegments, func(i, j int) bool {
|
||||
return fromSegments[i].GetNumOfRows() < fromSegments[j].GetNumOfRows()
|
||||
})
|
||||
|
@ -31,19 +31,6 @@ import (
|
||||
"github.com/milvus-io/milvus/pkg/util/tsoutil"
|
||||
)
|
||||
|
||||
func SegmentBinlogs2SegmentInfo(collectionID int64, partitionID int64, segmentBinlogs *datapb.SegmentBinlogs) *datapb.SegmentInfo {
|
||||
return &datapb.SegmentInfo{
|
||||
ID: segmentBinlogs.GetSegmentID(),
|
||||
CollectionID: collectionID,
|
||||
PartitionID: partitionID,
|
||||
InsertChannel: segmentBinlogs.GetInsertChannel(),
|
||||
NumOfRows: segmentBinlogs.GetNumOfRows(),
|
||||
Binlogs: segmentBinlogs.GetFieldBinlogs(),
|
||||
Statslogs: segmentBinlogs.GetStatslogs(),
|
||||
Deltalogs: segmentBinlogs.GetDeltalogs(),
|
||||
}
|
||||
}
|
||||
|
||||
func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*meta.Segment) {
|
||||
first := segments[0]
|
||||
if info.GetSegmentID() == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user