Skip to content
Snippets Groups Projects
Commit dfb68a7e authored by Yihao Dai's avatar Yihao Dai Committed by yefu.chen
Browse files

Remove unused segment


Signed-off-by: default avatarbigsheeper <yihao.dai@zilliz.com>
parent 4e8604c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
......@@ -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")
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment