TiDB Abnormal Restart, Statistics Lost, Analyze Cannot Refresh

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

Original topic: TIDB异常重启,统计信息丢失,analyze还刷不出来

| username: TiDBer_Jzo3iMXn

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.5.1
[Resource Configuration] 2 TiDB servers, 3 TiKV servers, 2 TiFlash servers

[Encountered Problem]

There are 2 TiDB servers, let’s call them serv1 and serv2;
Usually, we use serv1, and serv2 does not handle any traffic, serving only as a backup node;
serv1 experienced an abnormal restart, and after restarting, all statistical information was lost, and the result of executing SHOW STATS_HEALTHY was empty;
However, the statistical information on serv2 still appears normal, and executing SHOW STATS_HEALTHY displays normally;
Executing

analyze db_name.a_very_small_table

on serv1 has been stuck for two hours and has not completed.