Fix bug: should use Lock instead of RLock (#14797)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/14799/head
zhenshan.cao 2022-01-04 23:33:24 +08:00 committed by GitHub
parent d9bc40c033
commit b10c361822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -122,6 +122,9 @@ test-proxy:
@echo "Running go unittests..."
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/proxy -v
test-datanode:
@echo "Running go unittests..."
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/datanode -v
test-querycoord:
@echo "Running go unittests..."

View File

@ -471,8 +471,8 @@ func (replica *SegmentReplica) initPKBloomFilter(s *Segment, statsBinlogs []*dat
// listNewSegmentsStartPositions gets all *New Segments* start positions and
// transfer segments states from *New* to *Normal*.
func (replica *SegmentReplica) listNewSegmentsStartPositions() []*datapb.SegmentStartPosition {
replica.segMu.RLock()
defer replica.segMu.RUnlock()
replica.segMu.Lock()
defer replica.segMu.Unlock()
result := make([]*datapb.SegmentStartPosition, 0, len(replica.newSegments))
for id, seg := range replica.newSegments {