Skip to content

Commit

Permalink
dix
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
  • Loading branch information
xiaocai2333 committed Dec 27, 2024
1 parent eb880fd commit c8ded3d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/datacoord/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ func (h *ServerHandler) GetQueryVChanPositions(channel RWChannel, partitionIDs .
return true
}

var compactionFromExist func(segID UniqueID) bool
var compactionFromExist func(segID UniqueID, recursionCount int) bool

compactionFromExist = func(segID UniqueID) bool {
compactionFromExist = func(segID UniqueID, recursionCount int) bool {
if recursionCount > 5 {
return false
}
compactionFrom := validSegmentInfos[segID].GetCompactionFrom()
if len(compactionFrom) == 0 || !isValid(compactionFrom...) {
return false
Expand All @@ -205,7 +208,7 @@ func (h *ServerHandler) GetQueryVChanPositions(channel RWChannel, partitionIDs .
if flushedIDs.Contain(fromID) || newFlushedIDs.Contain(fromID) {
return true
}
if compactionFromExist(fromID) {
if compactionFromExist(fromID, recursionCount+1) {
return true
}
}
Expand All @@ -224,7 +227,7 @@ func (h *ServerHandler) GetQueryVChanPositions(channel RWChannel, partitionIDs .
newFlushedIDs.Insert(id)
continue
}
if segmentIndexed(id) && !compactionFromExist(id) {
if segmentIndexed(id) && !compactionFromExist(id, 0) {
newFlushedIDs.Insert(id)
} else {
for _, fromID := range compactionFrom {
Expand Down

0 comments on commit c8ded3d

Please sign in to comment.