Skip to content

planner: the optimizer can't use the latest tidb_mem_quota_binding_cache value to initialize binding cache #65381

Closed

Description

@qw4990

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Step 1: create massive bindings, and their total memory usage is larger than the default binding cache size 64MB
Step 2: restart TiDB and we'll see errors like he memory usage of all available bindings exceeds the cache's mem quota.
Step 3: increase the binding cache size through set global tidb_mem_quota_binding_cache = 1073741824;
Step 4: restart TiDB again, there should be no binding cache errors.

2. What did you expect to see? (Required)

In Step 4, there are still some binding cache errors:

Image

The root cause is that when starting TiDB nodes, we initialize binding cache before initializing system variables, so the optimizer can't get the latest value of tidb_mem_quota_binding_cache and then use the default value 64MB instead.

Image

3. What did you see instead (Required)

No error

4. What is your TiDB version? (Required)

v7.5, v8.5, Master

Activity

  1. added a commit that references this issue on Jan 2, 2026
    f409f34
  2. added a commit that references this issue on Jan 4, 2026
    60bf54f
  3. added a commit that references this issue on Jan 6, 2026
    f74c99c
  4. added a commit that references this issue on Jan 14, 2026
    9546cb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions