Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copr: fix copr cache panic when tidb_enable_collect_execution_info is off #48340

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,13 @@ func (worker *copIteratorWorker) handleCopCache(task *copTask, resp *copResponse
resp.pbResp.Range = nil
}
}
resp.detail.CoprCacheHit = true
// If the coprocessor cache key of the task is same whether `worker.enableCollectExecutionInfo` is true or false,
// the cache may be hit when `worker.enableCollectExecutionInfo` is false, but the `detail` is nil.
// Check `resp.detail` to avoid panic.
// Details: https://github.com/pingcap/tidb/issues/48212
if resp.detail != nil {
resp.detail.CoprCacheHit = true
}
return nil
}
copr_metrics.CoprCacheCounterMiss.Add(1)
Expand Down