mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Fix segment released early in case of balancing (#25453)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
5aad0ceec3
commit
9e3a591bda
@ -253,11 +253,9 @@ func (d *distribution) RemoveDistributions(sealedSegments []SegmentEntry, growin
|
||||
d.mut.Lock()
|
||||
defer d.mut.Unlock()
|
||||
|
||||
changed := false
|
||||
for _, sealed := range sealedSegments {
|
||||
if d.offlines.Contain(sealed.SegmentID) {
|
||||
d.offlines.Remove(sealed.SegmentID)
|
||||
changed = true
|
||||
}
|
||||
entry, ok := d.sealedSegments[sealed.SegmentID]
|
||||
if !ok {
|
||||
@ -265,7 +263,6 @@ func (d *distribution) RemoveDistributions(sealedSegments []SegmentEntry, growin
|
||||
}
|
||||
if entry.NodeID == sealed.NodeID || sealed.NodeID == wildcardNodeID {
|
||||
delete(d.sealedSegments, sealed.SegmentID)
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -276,14 +273,10 @@ func (d *distribution) RemoveDistributions(sealedSegments []SegmentEntry, growin
|
||||
}
|
||||
|
||||
delete(d.growingSegments, growing.SegmentID)
|
||||
changed = true
|
||||
}
|
||||
|
||||
if !changed {
|
||||
// no change made, return closed signal channel
|
||||
return getClosedCh()
|
||||
}
|
||||
|
||||
// wait previous read even not distribution changed
|
||||
// in case of segment balance caused segment lost track
|
||||
return d.genSnapshot()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user