A large number of errors occurred in TiDB

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb出现大量error

| username: zhanggame1

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 7.1
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]

2023-08-30 17:31:51 (UTC+08:00)

TiDB 10.10.10.220:4000
TiDB reports a large number of errors. Is there any impact on the cluster operation? As follows:
[handle.go:1150] [“fail to get stats version for this histogram”] [table_id=2312] [hist_id=1]

| username: cassblanca | Original post link

It looks like there is an issue with the dashboard fetching data.

| username: 有猫万事足 | Original post link

The error occurs at this line. Before the error, the following statement was executed:

select stats_ver from mysql.stats_histograms where is_index = 0 and table_id = %? and hist_id = %?

If no data is returned, this error will occur. The general meaning is that a certain column in one of your tables does not have histogram-type statistical information.

| username: tidb菜鸟一只 | Original post link

Find this table, then analyze the table to collect its statistics, and take a look?

| username: Fly-bird | Original post link

OP, please share your solution once you resolve it. I encountered the same issue during testing but didn’t pay much attention to it.

| username: zhanggame1 | Original post link

Statistics collection is in progress, under observation.

| username: yulei7633 | Original post link

Have you found the reason? I’ve encountered it too and couldn’t solve it.

| username: zhanggame1 | Original post link

Reanalyzed, still not resolved. It’s still reporting the error.

| username: zhanggame1 | Original post link

I don’t see any issues.

| username: TiDB_C罗 | Original post link

What about analyze table?

| username: zhanggame1 | Original post link

It doesn’t work, this table is very small with only a few rows of data.

| username: h5n1 | Original post link

SELECT DISTINCT stats_ver FROM mysql.stats_histograms WHERE table_id = 2312;
| username: zhanggame1 | Original post link

Return 0

| username: h5n1 | Original post link

After deleting the statistics with DROP STATS xxx, try reanalyzing.

| username: zhanggame1 | Original post link

I’ll give it a try.

| username: zhanggame1 | Original post link

After dropping the statistics with DROP STATS xxx and then analyzing, it seems there are no errors reported at the moment.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.