Skip to content

Commit 52340f8

Browse files
committed
pkg
1 parent 9db4429 commit 52340f8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/statistics/handle/syncload/stats_syncload.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package syncload
1616

1717
import (
18+
stderrors "errors"
1819
"math/rand"
1920
"runtime"
2021
"time"
@@ -350,7 +351,7 @@ func (s *statsSyncLoad) handleOneItemTask(task *statstypes.NeededItemTask) (err
350351
t := time.Now()
351352
needUpdate := false
352353
wrapper, err = s.readStatsForOneItem(sctx, item, wrapper, isPkIsHandle, task.Item.FullLoad)
353-
if err != nil {
354+
if err != nil || stderrors.As(err, failToGetHistMeta) {
354355
return err
355356
}
356357
if item.IsIndex {
@@ -369,6 +370,8 @@ func (s *statsSyncLoad) handleOneItemTask(task *statstypes.NeededItemTask) (err
369370
return nil
370371
}
371372

373+
var failToGetHistMeta = errors.New("fail to get hist meta")
374+
372375
// readStatsForOneItem reads hist for one column/index, TODO load data via kv-get asynchronously
373376
func (*statsSyncLoad) readStatsForOneItem(sctx sessionctx.Context, item model.TableItemID, w *statsWrapper, isPkIsHandle bool, fullLoad bool) (*statsWrapper, error) {
374377
failpoint.Inject("mockReadStatsForOnePanic", nil)
@@ -389,7 +392,7 @@ func (*statsSyncLoad) readStatsForOneItem(sctx sessionctx.Context, item model.Ta
389392
logutil.BgLogger().Error("fail to get hist meta for this histogram, possibly a deleted one", zap.Int64("table_id", item.TableID),
390393
zap.Int64("hist_id", item.ID), zap.Bool("is_index", item.IsIndex))
391394
// Although it is errors, we don't return err, because raise error will have to retry. it is unnecessay.
392-
return nil, nil
395+
return nil, failToGetHistMeta
393396
}
394397
if item.IsIndex {
395398
isIndexFlag = 1

0 commit comments

Comments
 (0)