Skip to content

Commit

Permalink
pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Oct 14, 2024
1 parent af2b750 commit 7dc9a99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/statistics/handle/syncload/stats_syncload.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (s *statsSyncLoad) handleOneItemTask(task *statstypes.NeededItemTask) (err
t := time.Now()
needUpdate := false
wrapper, err = s.readStatsForOneItem(sctx, item, wrapper, isPkIsHandle, task.Item.FullLoad)
if err != nil || stderrors.As(err, failToGetHistMeta) {
if err != nil || stderrors.Is(err, errGetHistMeta) {
return err
}
if item.IsIndex {
Expand All @@ -370,7 +370,7 @@ func (s *statsSyncLoad) handleOneItemTask(task *statstypes.NeededItemTask) (err
return nil
}

var failToGetHistMeta = errors.New("fail to get hist meta")
var errGetHistMeta = errors.New("fail to get hist meta")

// readStatsForOneItem reads hist for one column/index, TODO load data via kv-get asynchronously
func (*statsSyncLoad) readStatsForOneItem(sctx sessionctx.Context, item model.TableItemID, w *statsWrapper, isPkIsHandle bool, fullLoad bool) (*statsWrapper, error) {
Expand All @@ -392,7 +392,7 @@ func (*statsSyncLoad) readStatsForOneItem(sctx sessionctx.Context, item model.Ta
logutil.BgLogger().Error("fail to get hist meta for this histogram, possibly a deleted one", zap.Int64("table_id", item.TableID),
zap.Int64("hist_id", item.ID), zap.Bool("is_index", item.IsIndex))
// Although it is errors, we don't return err, because raise error will have to retry. it is unnecessay.
return nil, failToGetHistMeta
return nil, errGetHistMeta
}
if item.IsIndex {
isIndexFlag = 1
Expand Down

0 comments on commit 7dc9a99

Please sign in to comment.