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

Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
SimFG 2023-03-14 22:56:00 +08:00 committed by GitHub
parent 14ff4485ff
commit ba6666aed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
@ -129,6 +131,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()
}
}
}