Encountering frequent errors while generating data in TiDB, even though the nodes are running normally. Does anyone know what's going on?

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

Original topic: 往tidb里面生成数据老报错,节点也正常跑着,有知道怎么回事的么

| username: 朵拉大虾

【TiDB Usage Environment】/Testing
【TiDB Version】6.5
【Reproduction Path】During data generation
【Encountered Issue: Problem Description and Impact】TTL manager has timed out, pessimistic locks may expire, please commit or rollback this transaction
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】

| username: 考试没答案 | Original post link

The transaction was too large, and you submitted it. The pessimistic lock expired.

| username: 考试没答案 | Original post link

The image is not visible. Please provide the text you need translated.

| username: 朵拉大虾 | Original post link

May I ask if this can be scheduled without submitting?

| username: 考试没答案 | Original post link

What operation caused this error for you?

| username: wzf0072 | Original post link

Suggestions for handling:

  1. When encountering this error, it is recommended to check if the business logic can be optimized, such as splitting large transactions into smaller ones. Without using [large transactions], large transactions may trigger TiDB’s transaction limits.
  2. You can appropriately adjust relevant parameters to meet transaction requirements.
| username: wzf0072 | Original post link

In addition to the restriction that it cannot exceed the GC time, the TTL of a pessimistic lock has an upper limit, which is 1 hour by default. Therefore, a pessimistic transaction that takes more than 1 hour to execute may fail to commit. This timeout is specified by the TiDB parameter [performance.max-txn-ttl].

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

  1. tidb_lock_wait_timeout: This parameter is used to set the maximum time TiDB waits for a pessimistic lock. If the waiting time exceeds this value, TiDB will automatically give up waiting, roll back the transaction, and return an error. You can appropriately increase the value of this parameter based on actual conditions to reduce the risk of pessimistic lock expiration.
  2. tidb_gc_life_time: This parameter is used to set the interval for automatic GC (garbage collection) in TiDB. By appropriately adjusting this parameter, TiDB can more promptly reclaim expired data, reducing lock holding time and the risk of expiration.
| username: 朵拉大虾 | Original post link

When generating data with Navicat

| username: 朵拉大虾 | Original post link

I saw this. I want to ask how to modify the default one-hour configuration.

| username: 烂番薯0 | Original post link

UPDATE INFORMATION_SCHEMA.CLUSTER_CONFIG 
SET `VALUE` = xxxxx 
WHERE INFORMATION_SCHEMA.CLUSTER_CONFIG.`KEY` = 'performance.max-txn-ttl';
| username: 朵拉大虾 | Original post link

The image you provided is not visible. Please provide the text you need translated.

| username: system | Original post link

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