shenkonghui / issue

问题记录
0 stars 0 forks source link

【MYSQL】 Waiting for commit lock, 倒是second_behind_master 一直增加 #201

Closed shenkonghui closed 3 months ago

shenkonghui commented 3 months ago
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G
*************************** 1. row ***************************
                    trx_id: 14739
                 trx_state: RUNNING
               trx_started: 2024-05-23 16:21:45
     trx_requested_lock_id: NULL
          trx_wait_started: NULL
                trx_weight: 5
       trx_mysql_thread_id: 14
                 trx_query: NULL
       trx_operation_state: NULL
         trx_tables_in_use: 0
         trx_tables_locked: 2
          trx_lock_structs: 3
     trx_lock_memory_bytes: 1128
           trx_rows_locked: 1
         trx_rows_modified: 2
   trx_concurrency_tickets: 0
       trx_isolation_level: READ COMMITTED
         trx_unique_checks: 1
    trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
 trx_adaptive_hash_latched: 0
 trx_adaptive_hash_timeout: 0
          trx_is_read_only: 0
trx_autocommit_non_locking: 0
       trx_schedule_weight: NULL
1 row in set (0.00 sec)
mysql> show processlist;
+-------+-------------+----------------------+-------+------------------+-------+-----------------------------------------------------------------+------------------------+
| Id    | User        | Host                 | db    | Command          | Time  | State                                                           | Info                   |
+-------+-------------+----------------------+-------+------------------+-------+-----------------------------------------------------------------+------------------------+
|    12 | system user | connecting host      | NULL  | Connect          | 25551 | Waiting for source to send event                                | NULL                   |
|    13 | system user |                      | NULL  | Query            |  1030 | Waiting for dependent transaction to commit                     | NULL                   |
|    14 | system user |                      | NULL  | Query            |  1020 | Waiting for semi-sync ACK from slave
shenkonghui commented 3 months ago

rpl_semi_sync_master_timeout 属性设置的比较大, set global rpl_semi_sync_master_enabled=0 即可恢复