Recover the segmentIDs when fail to send tt (#22771)

Signed-off-by: SimFG <bang.fu@zilliz.com>
pull/22784/head
SimFG 2023-03-14 23:33:56 +08:00 committed by GitHub
parent cb96314fe7
commit bb55200878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -21,7 +21,9 @@ import (
"time"
"github.com/milvus-io/milvus/internal/log"
"github.com/samber/lo"
"go.uber.org/zap"
"golang.org/x/exp/maps"
)
type sendTimeTick func(Timestamp, []int64) error
@ -124,6 +126,11 @@ func (mt *mergedTimeTickerSender) work() {
if isDiffTs {
if err := mt.send(lastTs, sids); err != nil {
log.Error("send hard time tick failed", zap.Error(err))
mt.mu.Lock()
maps.Copy(mt.segmentIDs, lo.SliceToMap(sids, func(t int64) (int64, struct{}) {
return t, struct{}{}
}))
mt.mu.Unlock()
}
}
}