pymysql.err.InternalError: (9001, 'PD server timeout')

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

Original topic: pymysql.err.InternalError: (9001, ‘PD server timeout’)

| username: TiDBer_HXL

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 6.5.2
[Reproduction Path] Error reported when writing data
[Encountered Issues: Problem Phenomenon and Impact]
Error 1:
pymysql.err.InternalError: (8027, ‘Information schema is out of date: schema failed to update in 1 lease,
please make sure TiDB can connect to TiKV’)

Error 2:
pymysql.err.InternalError: (9001, ‘PD server timeout’)

[Resource Configuration] Single-machine deployment of TiDB

| username: Billmay表妹 | Original post link

Error 1: This error indicates that while executing a DML statement, TiDB failed to update the schema within a DDL lease (default is 45 seconds), possibly because TiDB could not connect to TiKV.

Possible reasons for this error include:

  • The TiDB server executing the DML statement was “gracefully killed” and is preparing to exit. The transaction containing the DML statement took longer than one DDL lease to execute. The error occurs when the transaction is committed.
  • When executing the DML statement, the TiDB server could not connect to PD or TiKV. Therefore, the TiDB server failed to load the new schema within one DDL lease (default is 45 seconds), or the TiDB server disconnected from PD using the “keep alive” setting.
  • TiKV is under high load or there is a network timeout.

To resolve this issue, you can try the following solutions:

  • For reason 1, retry the DML operation when TiDB starts.
  • For reason 2, check the network connection between the TiDB server and PD/TiKV.
  • For reason 3, check the node load in GrafanaTiDB and TiKV.
| username: Billmay表妹 | Original post link

Error 2:
This error indicates that TiDB cannot connect to PD, which may be due to a PD node failure or network issues.

To resolve this issue, you can try the following solutions:

  • Check if the PD node is down or if the network is functioning properly.
  • Verify that the PD address in the TiDB configuration file is correct.
  • Check the firewall settings in the TiDB cluster to ensure that the PD node’s port can be accessed.
  • Check the clock synchronization settings in the TiDB cluster to ensure that the clocks of all nodes are synchronized properly.
| username: Billmay表妹 | Original post link

Using TiDB on a single machine might not be as good as using MySQL.

| username: system | Original post link

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