No. | Possible cause |
1 | A single transaction writes an excessive amount of data, exceeding the tdstore_max_txn_size limit, which causes the transaction to be rejected. |
2 | The number of participants (RGs) involved in a single transaction exceeds the tdsql_transaction_max_participants limit. |
3 | Batch import operations (such as LOAD DATA and INSERT ... SELECT) are not executed in batches, resulting in an excessive amount of data per single operation. |
4 | A long-running transaction executes for an excessive duration, holds locks and memory resources for too long, and affects other workloads. |
5 | Operations such as ALTER TABLE on large tables generate a large amount of data copying, resulting in an oversized transaction. |
Possible cause | Problem-solving Ideas |
Excessive data volume in a single transaction | Split large transactions into multiple smaller ones and adjust the tdstore_max_txn_size parameter via the console. |
Excessive number of participants | Reduce the number of tables and partitions involved in a single transaction, and execute cross-table operations in batches. |
Batch import not executed in batches | Split a large batch import into multiple smaller batches, with each batch controlled within a reasonable data volume. |
Long-running transaction holding locks for an excessive duration | Optimize the execution efficiency of SQL statements within transactions, reduce the transaction scope, and set a reasonable timeout period. |
Excessive data copying during DDL operations | Verify that the tdsql_split_trans_during_alter_copy parameter has been enabled, so that DDL automatically splits transactions. |
Monitoring Metric | Description | Focus |
Number of Failed SQL Queries | Number of failed SQL statements per second | The number of failures surges when transactions exceed the limit. |
Memory utilization | Instance memory utilization | Whether memory usage surges during large transaction execution. |
Transactions per second | Transactions committed per second | Whether the number of transactions abnormally decreases. |
Number of slow queries | Number of slow queries per second | Whether large transactions cause other queries to slow down. |
Number of Active Threads | Current number of active threads | Whether any threads are blocked by large transactions for a long time. |
SELECTreplication_group_id,transaction_id,disk_usage_bytes,memory_usage_bytes,rollback,destroyedFROM information_schema.TDSTORE_LARGE_TXNWHERE destroyed = 0ORDER BY disk_usage_bytes DESCLIMIT 20;
replication_group_id: The ID of the RG.transaction_id: The ID of the transaction.disk_usage_bytes: Disk usage (in bytes). It reflects the size of transaction data in SST files.memory_usage_bytes: Memory usage (in bytes). It reflects the size of transactions in the MemTable.rollback: Whether it has been rolled back.destroyed: Whether it has been terminated.disk_usage_bytes or memory_usage_bytes value, record its transaction_id for subsequent troubleshooting.SELECTID,USER,HOST,DB,COMMAND,TIME,STATE,INFOFROM information_schema.PROCESSLISTWHERE COMMAND != 'Sleep'ORDER BY TIME DESCLIMIT 20;
TIME value, as they may be executing long-running or large transactions.PROCESSLIST query result in Step 2.3, comprehensively locate the session ID corresponding to the large transaction using information such as execution time and SQL text.KILL <session_id>;
KILL operation interrupts the currently executing transaction and triggers a rollback, which may continue to consume resources during the rollback process. Confirm the target session before executing this command to avoid terminating normal business sessions by mistake.tdstore_max_txn_size parameter via the console. For detailed operations, see Set Instance Parameters.tdstore_max_txn_size value raises the memory that a single transaction can occupy, which may lead to increased memory pressure in high-concurrency scenarios.INSERT INTO ... SELECT ... statement into multiple subqueries with LIMIT.tdstore_max_txn_size limit.LOAD DATA, you can adjust the following parameters via the console. For detailed operations, see Set Instance Parameters.tdstore_bulk_load_total_merge_buffer_size: The total size of the merge buffer for batch imports, which controls memory usage during batch import operations.tdstore_bulk_load_merge_chunk_size: The size of a single merge chunk for batch imports, which controls the data volume for each merge sorting operation.max_execution_time: The maximum execution time (in milliseconds) for SELECT statements. Setting it to a reasonable value prevents slow queries from running for extended periods.wait_timeout: The idle timeout for connections (in seconds). Connections that remain inactive beyond this duration are automatically closed.ALTER TABLE and other large-table DDL operations involve data copying, which can lead to oversized transactions. TDSQL Boundless supports automatically splitting transactions during DDL to prevent individual transactions from becoming too large. Adjust the following parameters based on your business needs. For detailed operations, see Set Instance Parameters.tdsql_split_trans_during_alter_copy parameter: Confirm that its value is ON. If it is OFF, change it to ON to enable automatic splitting and committing of small transactions during DDL data copying.tdsql_bulk_commit_records parameter: Controls the number of records committed per batch during DDL copying. Its default value is 3000, which can be adjusted appropriately based on table data volume.tdsql_txn_keep_alive_lease_sec parameter. This parameter controls how long TDStore waits without receiving a transaction heartbeat before releasing the transaction context. Its default value is 3600 seconds (1 hour). If a large transaction's execution time exceeds this value, you can appropriately increase it. For detailed operations, see Set Instance Parameters.tdsql_split_trans_during_alter_copy has been enabled to prevent DDL from generating oversized transactions.피드백