percona - How come I still get deadlocks even after setting wsrep_retry_autocommit really high? -
i have cluster of 3 percona xtradb 5.5.34-55 servers , since writable, deadlock errors under substantial load. increasing wsrep_retry_autocommit
variable helped extent, er_lock_deadlock
did not disappear completely. i've tried setting wsrep_retry_autocommit
10000 (seems maximum), thinking make queries slow, none of them fail er_lock_deadlock
:
mysql-shm -ss -e 'show global variables "%wsrep_retry_auto%"' wsrep_retry_autocommit 10000 ------------------------ latest detected deadlock ------------------------ 140414 10:29:23 *** (1) transaction: transaction 72d8, active 0 sec inserting mysql tables in use 1, locked 1 lock wait 2 lock struct(s), heap size 376, 1 row lock(s), undo log entries 1 mysql thread id 34, os thread handle 0x7f11840d4700, query id 982 localhost shm update replace metric(host, name, userid, sampleid, type, priority) values ('localhost','cpu-3/cpu-nice',8,0,0,0),('localhost','cpu-3/cpu-system',8,0,0,0), ('localhost','cpu-3/cpu-idle',8,0,0,0),('localhost','cpu-3/cpu-wait',8,0,0,0), ('localhost','cpu-3/cpu-interrupt',8,0,0,0),('localhost','cpu-3/cpu-softirq',8,0,0,0), ('localhost','cpu-3/cpu-steal',8,0,0,0),('localhost','cpu-4/cpu-user',8,0,0,0), ('localhost','cpu-4/cpu-nice',8,0,0,0),('localhost','cpu-4/cpu-system',8,0,0,0), ('localhost','cpu-4/cpu-idle',8,0,0,0),('localhost','cpu-4/cpu-wait',8,0,0,0), ('localhost','cpu-4/cpu-interrupt',8,0,0,0),('localhost','cpu-4/cpu-softirq',8,0,0,0), ('localhost','cpu-4/cpu-steal',8,0,0,0) *** (1) waiting lock granted: record locks space id 0 page no 344 n bits 488 index `unique-metric` of table `shm`.`metric` trx id 72d8 lock_mode x waiting *** (2) transaction: transaction 72d7, active 0 sec updating or deleting mysql tables in use 1, locked 1 7 lock struct(s), heap size 3112, 141 row lock(s), undo log entries 40 mysql thread id 50, os thread handle 0x7f1184115700, query id 980 localhost shm update replace metric(host, name, userid, sampleid, type, priority) values ('localhost','cpu-3/cpu-nice',8,0,0,0),('localhost','cpu-3/cpu-system',8,0,0,0), ('localhost','cpu-3/cpu-idle',8,0,0,0),('localhost','cpu-3/cpu-wait',8,0,0,0), ('localhost','cpu-3/cpu-interrupt',8,0,0,0),('localhost','cpu-3/cpu-softirq',8,0,0,0), ('localhost','cpu-3/cpu-steal',8,0,0,0),('localhost','cpu-4/cpu-user',8,0,0,0), ('localhost','cpu-4/cpu-nice',8,0,0,0),('localhost','cpu-4/cpu-system',8,0,0,0), ('localhost','cpu-4/cpu-idle',8,0,0,0),('localhost','cpu-4/cpu-wait',8,0,0,0), ('localhost','cpu-4/cpu-interrupt',8,0,0,0),('localhost','cpu-4/cpu-softirq',8,0,0,0), ('localhost','cpu-4/cpu-steal',8,0,0,0),('localhost','cpu-3/cpu-nice',8,0,0,0), ('localhost','cpu-3/cpu-system',8,0,0,0),('localhost','cpu-3/cpu-idle',8,0,0,0), ('localhost','cpu-3/cpu-wait',8,0,0,0),('localhost','cpu-3/cpu-interrupt',8,0,0,0), ('localhost','cpu-3/cpu-softirq',8,0,0,0),('localhost' *** (2) holds lock(s): record locks space id 0 page no 344 n bits 488 index `unique-metric` of table `shm`.`metric` trx id 72d7 lock_mode x *** (2) waiting lock granted: record locks space id 0 page no 344 n bits 504 index `unique-metric` of table `shm`.`metric` trx id 72d7 lock_mode x locks gap before rec insert intention waiting *** roll transaction (1)
shouldn't retried instead? there way verify percona retried query 10000 times?
don't have exact answer question, write-intensive loads (if you try insert same data damn drupal does), deadlocks happen, , solution me (still waiting confirm 100% ok solution)- use haproxy in front of galera nodes, , define first node (haproxy backend definition) used, , other 2 nodes used backup.
this way mysql traffic flow clients, via haproxy single galera node, , if node fails, other node used.
hope helps... andrija
Comments
Post a Comment