-
2024.06.29 deadlockTIL 2024. 6. 29. 15:40
MySQL :: MySQL 5.7 Reference Manual :: 14.7.5.3 How to Minimize and Handle Deadlocks
14.7.5.3 How to Minimize and Handle Deadlocks This section builds on the conceptual information about deadlocks in Section 14.7.5.2, “Deadlock Detection”. It explains how to organize database operations to minimize deadlocks and the subsequent error
dev.mysql.com
데드락은 일어날 수 있는 일이고 항상 가능성을 열어두어라.
매번 트랜잭션을 실행할 수 없다면 문제가 되겠지만 그 보다 재시도를 설계하라.
한 트랜잭션 안에서 변경되는 row 수를 줄이고 lock을 최소로 잡아라.
인덱스 설계를 잘해서 더 적은 수의 lock이 걸리게 하라.
MySQL :: MySQL 5.7 Reference Manual :: 14.7.5.2 Deadlock Detection
14.7.5.2 Deadlock Detection When deadlock detection is enabled (the default), InnoDB automatically detects transaction deadlocks and rolls back a transaction or transactions to break the deadlock. InnoDB tries to pick small transactions to roll back, wher
dev.mysql.com
mysql 자동 데드락(deadlock) 감지기능
InnoDB 스토리지 엔진은 내부적으로 잠금이 교착 상태에 빠지지 않았는지 체크하기 위해 잠금 대기 목록을 그래프(Wait-for List) 형태로 관리한다. InnoDB 스토리지 엔진은 데드락 감지 스레드를 가지
dung-beetle.tistory.com
innodb_deadlock_detect - Rather Hands off!
Recently we had a new customer who has had from time to time massive database problems which he did not understand. When we reviewed the MySQL configuration file (my.cnf) we found, that this customer had disabled the InnoDB Deadlock detection (innodb_deadl
fromdual.com
데드락 감지 설정은 기본으로 설정되어있다.
mysql은 잠금을 수행할 때마다 잠금이 교착상태를 유발하는지 확인하는 것이다.
높은 동시성을 요구할 때 성능저하가 있을 수 있기때문이다.
해당 설정을 꺼 놓는다면 데드락 감지 스레드가 동작하지 않아 무한대기가 된다. 설정을 껐다면 innodb_lock_wait_time을 사용하자.
데드락 발생 시 롤백을 해야하는데 어느 트랜잭션을 롤백할 것인가.
변경되는 row수가 적은 트랜잭션을 롤백한다
deadlock detect와 innodb_lock_wait_time를 둘 다 키면?
MySQL :: MySQL 8.0 Reference Manual :: 17.14 InnoDB Startup Options and System Variables
dev.mysql.com
deadlock detect이 켜져 있으면 innodb_lock_wait_time은 사용되지 않는다.
.
https://dev.mysql.com/doc/refman/8.0/en/glossary.html#glos_row_lock
MySQL :: MySQL 8.0 Reference Manual :: MySQL Glossary
MySQL 8.0 Reference Manual / MySQL Glossary These terms are commonly used in information about the MySQL database server. A .ARM file Metadata for ARCHIVE tables. Contrast with .ARZ file. Files with this extension are always included in backups produce
dev.mysql.com
row lock에 대해서.
'TIL' 카테고리의 다른 글
2024.07.01 wait-for-graph (0) 2024.07.01 2024.06.30 (0) 2024.06.30 2024.06.27 canary, AB test (0) 2024.06.27 2024.06.23 feature toggle (0) 2024.06.25 2024.06.16 (0) 2024.06.15