Use clone instead of ShadowClone when update pb data (#8461)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/8478/head
congqixia 2021-09-24 12:53:54 +08:00 committed by GitHub
parent a182326c60
commit ca62b1e149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ func (s *SegmentsInfo) SetSegment(segmentID UniqueID, segment *SegmentInfo) {
// if SegmentInfo not found, do nothing
func (s *SegmentsInfo) SetRowCount(segmentID UniqueID, rowCount int64) {
if segment, ok := s.segments[segmentID]; ok {
s.segments[segmentID] = segment.ShadowClone(SetRowCount(rowCount))
s.segments[segmentID] = segment.Clone(SetRowCount(rowCount))
}
}
@ -82,7 +82,7 @@ func (s *SegmentsInfo) SetRowCount(segmentID UniqueID, rowCount int64) {
// if SegmentInfo not found, do nothing
func (s *SegmentsInfo) SetState(segmentID UniqueID, state commonpb.SegmentState) {
if segment, ok := s.segments[segmentID]; ok {
s.segments[segmentID] = segment.ShadowClone(SetState(state))
s.segments[segmentID] = segment.Clone(SetState(state))
}
}