Skip to content

Commit

Permalink
statistics: add some key info in sync load timeout log (#49630)
Browse files Browse the repository at this point in the history
close #49631
  • Loading branch information
elsa0520 authored Dec 20, 2023
1 parent 00e52ad commit 6a5a5e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/statistics/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package statistics

import (
"strconv"

"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/util/debugtrace"
Expand Down Expand Up @@ -168,7 +166,9 @@ func (c *Column) IsInvalid(
if (!c.IsStatsInitialized() || c.IsLoadNeeded()) && stmtctx != nil {
if stmtctx.StatsLoad.Timeout > 0 {
logutil.BgLogger().Warn("Hist for column should already be loaded as sync but not found.",
zap.String(strconv.FormatInt(c.Info.ID, 10), c.Info.Name.O))
zap.Int64("table_id", c.PhysicalID),
zap.Int64("column_id", c.Info.ID),
zap.String("column_name", c.Info.Name.O))
}
// In some tests, the c.Info is not set, so we add this check here.
// When we are using stats from PseudoTable(), the table ID will possibly be -1.
Expand Down

0 comments on commit 6a5a5e7

Please sign in to comment.