Skip to content

Commit

Permalink
*: fix auto analyze worker crash when killed by tidb_mem_quota_analyze (
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Dec 20, 2022
1 parent 0b54d9e commit 36ec580
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions statistics/handle/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,11 @@ func (h *Handle) getAnalyzeSnapshot() (bool, error) {

// HandleAutoAnalyze analyzes the newly created table or index.
func (h *Handle) HandleAutoAnalyze(is infoschema.InfoSchema) (analyzed bool) {
defer func() {
if r := recover(); r != nil {
logutil.BgLogger().Error("HandleAutoAnalyze panicked", zap.Any("error", r), zap.Stack("stack"))
}
}()
err := h.UpdateSessionVar()
if err != nil {
logutil.BgLogger().Error("[stats] update analyze version for auto analyze session failed", zap.Error(err))
Expand Down

0 comments on commit 36ec580

Please sign in to comment.