mirror of https://github.com/milvus-io/milvus.git
fix: the insert count is zero after set the pointer to nil (#29870)
this leads to the EntitiesNum metric would be never reduced fix: #29766 Signed-off-by: yah01 <yang.cen@zilliz.com>pull/29890/head
parent
a4f15f4f43
commit
26e900180e
|
@ -250,10 +250,6 @@ func (s *LocalSegment) InsertCount() int64 {
|
|||
s.ptrLock.RLock()
|
||||
defer s.ptrLock.RUnlock()
|
||||
|
||||
if !s.isValid() {
|
||||
return 0
|
||||
}
|
||||
|
||||
return s.insertCount.Load()
|
||||
}
|
||||
|
||||
|
@ -1012,5 +1008,6 @@ func (s *LocalSegment) Release() {
|
|||
zap.Int64("partitionID", s.partitionID),
|
||||
zap.Int64("segmentID", s.ID()),
|
||||
zap.String("segmentType", s.typ.String()),
|
||||
zap.Int64("insertCount", s.InsertCount()),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -171,7 +171,6 @@ func (suite *SegmentSuite) TestSegmentReleased() {
|
|||
sealed.ptrLock.RLock()
|
||||
suite.False(sealed.isValid())
|
||||
sealed.ptrLock.RUnlock()
|
||||
suite.EqualValues(0, sealed.InsertCount())
|
||||
suite.EqualValues(0, sealed.RowNum())
|
||||
suite.EqualValues(0, sealed.MemSize())
|
||||
suite.False(sealed.HasRawData(101))
|
||||
|
|
Loading…
Reference in New Issue