pingcap / pingcap/tidb

planner: trigger a cluster level binding cache refresh after updating binding cache size

Open
#65,379 0 comments 0 reactions 0 assignees View on GitHub
component/spm sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
If the binding cache size is too small, TiDB can't load all bindings into memory, and some queries could encounter a binding cache miss problem.
But after increasing the binding cache through `set global tidb_mem_quota_binding_cache = ?`, TiDB won't refresh the binding cache automatically, which means these missing bindings are still missing in the cache.
Usually, we advise users to run `admin reload bindings` manually to load all missing bindings into the cache after increasing the binding cache. But this seems inconvenient and risky since some users might forget this step.

Below is a concrete example, where the user increased their binding cache size, but forgot to refresh the cache. Then later, when queries come, many queries encountered the binding missing problem and caused soem performance problems.
Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.