Remove unused segment

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
bigsheeper 2021-03-25 16:08:08 -05:00 committed by yefu.chen
parent 4e8604c1bc
commit dfb68a7e46
2 changed files with 6 additions and 0 deletions

View File

@ -540,11 +540,13 @@ func (colReplica *collectionReplica) replaceGrowingSegmentBySealedSegment(segmen
colReplica.mu.Lock()
defer colReplica.mu.Unlock()
if segment.segmentType != segmentTypeSealed && segment.segmentType != segmentTypeIndexing {
deleteSegment(segment)
return errors.New("unexpected segment type")
}
targetSegment, err := colReplica.getSegmentByIDPrivate(segment.ID())
if err == nil && targetSegment != nil {
if targetSegment.segmentType != segmentTypeGrowing {
deleteSegment(segment)
// target segment has been a sealed segment
return nil
}

View File

@ -350,6 +350,10 @@ func (s *Segment) segmentInsert(offset int64, entityIDs *[]UniqueID, timestamps
int sizeof_per_row,
signed long int count);
*/
if s.segmentType != segmentTypeGrowing || s.enableLoadBinLog {
return nil
}
if s.segmentPtr == nil {
return errors.New("null seg core pointer")
}