Skip to content

refine information schema cache #48285

@crazycs520

Description

@crazycs520

Enhancement

workload: stale read, with tidb_read_staleness=-60;

 sysbench --config-file=sysbench.conf stale_read.lua --threads=20 --read_staleness=-60 --kv_read_timeout=100 --max_execution_time=400 --mysql-ignore-errors=all run

When TiDB domain load schema meets following error:

[2023/11/03 18:29:30.023 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=2410] [startTS=445384588003639307]

The QPS will droped cause by information schema cache is missed, then need to load snapshot information schema.

image

This is caused by information schema cache will be invalid since there is a schema version with schemaTs=0, then infoCache.GetBySnapshotTS will always return nil.

version: v6.5.5

Metadata

Metadata

Assignees

Labels

type/enhancementThe issue or PR belongs to an enhancement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions