mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix bug for align segments (#17652)
Signed-off-by: Cai.Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
c185747552
commit
3610cc77bf
@ -1009,10 +1009,10 @@ func (mt *MetaTable) AlignSegmentsMeta(collID, partID UniqueID, segIDs map[Uniqu
|
||||
for segID := range segMap {
|
||||
if _, ok := segIDs[segID]; !ok {
|
||||
recycledSegIDs = append(recycledSegIDs, segID)
|
||||
}
|
||||
if idxID2segIndex, ok := mt.segID2IndexMeta[segID]; ok {
|
||||
for _, segIndex := range idxID2segIndex {
|
||||
recycledBuildIDs = append(recycledBuildIDs, segIndex.BuildID)
|
||||
if idxID2segIndex, ok := mt.segID2IndexMeta[segID]; ok {
|
||||
for _, segIndex := range idxID2segIndex {
|
||||
recycledBuildIDs = append(recycledBuildIDs, segIndex.BuildID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -502,11 +502,14 @@ func (c *Core) checkFlushedSegments(ctx context.Context) {
|
||||
}
|
||||
recycledSegIDs, recycledBuildIDs := c.MetaTable.AlignSegmentsMeta(collID, partID, segIDs)
|
||||
log.Info("there buildIDs should be remove index", zap.Int64s("buildIDs", recycledBuildIDs))
|
||||
if err := c.CallRemoveIndexService(ctx, recycledBuildIDs); err != nil {
|
||||
log.Error("CallRemoveIndexService remove indexes on segments failed",
|
||||
zap.Int64s("need dropped buildIDs", recycledBuildIDs), zap.Error(err))
|
||||
continue
|
||||
if len(recycledBuildIDs) > 0 {
|
||||
if err := c.CallRemoveIndexService(ctx, recycledBuildIDs); err != nil {
|
||||
log.Error("CallRemoveIndexService remove indexes on segments failed",
|
||||
zap.Int64s("need dropped buildIDs", recycledBuildIDs), zap.Error(err))
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if err := c.MetaTable.RemoveSegments(collID, partID, recycledSegIDs); err != nil {
|
||||
log.Warn("remove segments failed, wait to retry", zap.Int64("collID", collID), zap.Int64("partID", partID),
|
||||
zap.Int64s("segIDs", recycledSegIDs), zap.Error(err))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user