Fix data race in internal/datacoord/meta.go (#6005)

Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
sunby 2021-06-23 12:20:06 +08:00 committed by GitHub
parent fe8432016d
commit a529410b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,6 +345,8 @@ func (m *meta) SaveBinlogAndCheckPoints(segID UniqueID, flushed bool,
} }
func (m *meta) GetSegmentsByChannel(dmlCh string) []*datapb.SegmentInfo { func (m *meta) GetSegmentsByChannel(dmlCh string) []*datapb.SegmentInfo {
m.RLock()
defer m.RUnlock()
infos := make([]*datapb.SegmentInfo, 0) infos := make([]*datapb.SegmentInfo, 0)
for _, segment := range m.segments { for _, segment := range m.segments {
if segment.InsertChannel != dmlCh { if segment.InsertChannel != dmlCh {