The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
This document provides an overview of locking, blocking, and transaction isolation levels in SQL Server. It begins with an introduction to locking and how SQL Server uses locks for concurrency control. It then discusses the different lock types, lock compatibility, and the lock hierarchy. The document demonstrates how to view locking information and troubleshoot locking problems. It also covers lock escalation, deadlocks, and resolving blocking issues. Finally, it concludes with an explanation of the various transaction isolation levels supported by SQL Server and how they differ in terms of concurrency and consistency.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
There will always be locking inside your SQL Server box! In this session we go deep into how locking mechanism works, what are the main problems around locking, how we can resolve them and when isolation levels can actually be of help!
Lightweight locks (LWLocks) in PostgreSQL provide mutually exclusive access to shared memory structures. They support both shared and exclusive locking modes. The LWLocks framework uses wait queues, semaphores, and spinlocks to efficiently manage acquiring and releasing locks. Dynamic monitoring of LWLock events is possible through special builds that incorporate statistics collection.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
Concurrency control techniques ensure consistency and reliability of concurrent transactions in a database. They synchronize transaction operations to maintain consistency while allowing maximum concurrency. Three main techniques are locking-based protocols, timestamp ordering, and optimistic concurrency control. Locking-based protocols like two-phase locking use locks to control access to shared data and guarantee serializability. Timestamp ordering assigns timestamps to transactions and validates reads and writes based on timestamp order. Optimistic concurrency control allows transactions to read and write tentatively without locking, and validates at the end to commit only if no conflicts occurred.
The document discusses database security. It defines database security as mechanisms that protect databases from intentional or unintentional threats like theft, fraud, loss of confidentiality, integrity, and availability. It discusses various security threats and countermeasures like authorization, views, backups, encryption, and locking. It describes different types of locks like shared and exclusive locks. It also covers authorization, views, backups, integrity controls, encryption, and PL/SQL security features like explicit locking statements.
Using Release(deallocate) and Painful Lessons to be learned on DB2 lockingJohn Campbell
This document discusses thread reuse using the RELEASE(DEALLOCATE) bind option in DB2, considerations for lock avoidance, and lessons learned on DB2 locking. It provides primers on thread reuse, the RELEASE bind option, lock avoidance techniques like commit log sequence numbers and possibly uncommitted bits, and the ramifications of lock avoidance for SQL. It recommends using programming techniques to avoid data currency exposures when using lock avoidance, and outlines how to identify packages that can safely be rebound with CURRENTDATA(NO).
Up to MySQL 5.5, replication was not crash safe: it would fail with “dup.key” or “not found” error (or data corruption). So 5.6 is better, right? Maybe: it is possible, but not the default. MySQL 5.7 is not much better, 8.0 has safer defaults but it is still easy to get things wrong.
Crash safety is impacted by positioning (File+Pos or GTID), type (single/multi-threaded), MTS settings (Db/Logical Clock, and preserve commit order), the sync-ing of relay logs, the presence of binlogs, log-slave-updates and their sync-ing. This is complicated and even the manual is confused about it.
In this talk, I will explain above with details on replication internals, so you might learn a thing or two.
This document summarizes concurrency control techniques in database systems. It discusses lock-based protocols, including lock compatibility matrices, two-phase locking, lock conversions, and automatic lock acquisition. It also describes potential issues with locking such as deadlocks and starvation. Implementation of locking involves a lock manager process that maintains a lock table to track granted locks and pending requests.
Database concurrency and transactions - Tal Oliersqlserver.co.il
This document provides an overview of database transactions and locking concepts. It discusses the ACID model which guarantees atomicity, consistency, isolation, and durability. It describes different isolation levels and how they handle phenomena like dirty reads. It also covers locking types including exclusive and share locks. Advanced topics covered include concurrency, lock escalation, and how transactions and locking are implemented differently in Oracle and SQL Server.
The nightmare of locking, blocking and isolation levelsBoris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a nightmare! I also know that you struggle to find some time to go a bit deeper and learn what the various isolation levels can do for you. In this one-hour session, you will be able to see and understand why locking happens, how the locking manager actually works and how can we resolve various locking problems with different techniques ranging from query hints to changing the isolation levels.
Troubleshooting Deadlocks in SQL Server 2000elliando dias
The document discusses deadlocks in SQL Server 2000, including:
1. Deadlocking concepts like lock-based and multi-resource deadlocks.
2. Types of lock deadlocks like single-resource conversion deadlocks and multi-resource exclusive or mixed exclusive-shared deadlocks.
3. Gathering deadlock information in SQL Server like error 1205 and identifying blocking and deadlocked processes.
Long thought to be relegated to the domain of fast, multithreaded desktop applications, race conditions have made their way into web applications. These bugs are often difficult to test for, and are becoming increasingly prevalent due to faster and faster clients, while server-side languages like Node.js and PHP are struggling to keep up. Race conditions are no longer just bugs- when they are found in critical components of web applications, they become a serious security vulnerability. If the proper checks and defensive measures are not in place, databases get confused, “one-time-use” becomes a relative term, and “limited” becomes “unlimited”. This talk will detail specific examples where malicious users could cause damage or profit from a race-condition flaw in a web application. A custom open-source tool will also be introduced to help security researchers and developers easily check for this class of vulnerability in web applications.
MySQL Parallel Replication: inventory, use-cases and limitationsJean-François Gagné
In the last 24 months, MySQL replication speed has improved a lot thanks to implementing parallel replication. MySQL and MariaDB have different types of parallel replication; in this talk, I present in detail the different implementations, with their limitations and the corresponding tuning parameters (covering MySQL 5.6, MariaDB 10.0, MariaDB 10.1 and MySQL 5.7). I also present benchmark results from real Booking.com workloads. Finally, I discuss some deployments at Booking.com that benefits from parallel replication speed improvements.
MySQL 5.7 clustering: The developer perspectiveUlf Wendel
(Compiled from revised slides of previous presentations - skip if you know the old presentations)
A summary on clustering MySQL 5.7 with focus on the PHP clients view and the PHP driver. Which kinds on MySQL clusters are there, what are their goal, how does wich one scale, what extra work does which clustering technique put at the client and finally, how the PHP driver (PECL/mysqlnd_ms) helps you.
The document discusses concepts related to concurrency and multithreading in Java. It defines key terms like threads, locks, and conditions. It explains that threads allow independent tasks to run concurrently for improved performance. Synchronization ensures predictable sharing of memory between threads using monitors, volatile fields provide a lightweight synchronization. Locks provide more flexible locking than synchronized blocks. Conditions can be used to signal between threads waiting on a shared resource like a blocking queue.
Running Galera Cluster in Microsoft Azure involves setting up virtual machines and installing Galera Cluster software. This provides more control than Azure Database for MySQL, which uses asynchronous replication. While Azure Database for MySQL is fully managed, Galera Cluster in VMs supports the virtually synchronous replication that is its core feature. Cost estimates show running three Galera Cluster nodes in VMs costs less monthly than three hosted MySQL instances in Azure Database for MySQL.
MySQL Cluster Asynchronous replication (2014) Frazer Clement
Slides from 2014 describing basic features and implementation of MySQL Cluster asynchronous (binlog) replication, with some monitoring and tuning guidance.
This document discusses concurrency control techniques for transaction processing systems. It covers topics like two-phase locking, lock conversion deadlocks, multigranularity locking, hot spot techniques including partitioning and batching, query-update conflicts resolved through weaker isolation levels or multiversion data, and Oracle's multiversion concurrency control approach.
This document discusses concurrency control techniques for transaction processing systems. It covers topics like two-phase locking, lock conversion deadlocks, multigranularity locking, hot spot techniques including partitioning and batching, query-update conflicts resolved through techniques like multiversion data, and Oracle's multiversion concurrency control approach.
The document discusses different types of locks that can be used for thread synchronization in multi-threaded programming. It describes reentrant locks, read-write locks, stamped locks, spin locks, semaphores, and distributed locks. Distributed locks like RedLock provide safety and liveness guarantees to coordinate access to shared resources across multiple servers.
The nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
This document provides an introduction and overview of key blockchain concepts for developers, including accounts, wallets, transactions, test networks, blockchain clients, and decentralization. It begins with definitions of blockchain accounts, wallets, and transactions. It then discusses the purpose of test networks for blockchain development. It also defines blockchain clients and remote clients and their roles in interacting with blockchain networks. Finally, it discusses the importance of decentralization for blockchains. The document is presented as part of a blockchain solution designer course to provide essential background information for learning blockchain development.
The nightmare of locking, blocking and isolation levelsBoris Hristov
This document discusses transaction locking and isolation levels in SQL Server. It begins with an introduction to locks, their types (shared, update, exclusive), and how they are used for concurrency control. It then covers locking troubleshooting topics like lock escalation, deadlocks, and blocking. The document concludes with an overview of the different transaction isolation levels in SQL Server, including the tradeoffs between pessimistic and optimistic concurrency control approaches.
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Severalnines
This document provides an overview and agenda for a webinar on managing and monitoring MySQL clusters using ClusterControl by Severalnines. The webinar host is introduced and instructions are provided for asking questions. The webinar will cover topics such as operating system configuration, backup strategies, replication, query performance, schema changes, security, reporting, and disaster recovery. Case studies and customers are also briefly mentioned.
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”GlobalLogic Ukraine
Сучасні технічні інтерв’ю можуть викликати хвилювання навіть у досвідчених кандидатів. Вимоги, які постійно зростають, нові інструменти, дедалі жорсткіший відбір — це лише частина викликів. Під час цієї доповіді ви отримаєте відповіді на всі важливі питання щодо підготовки та проходження інтерв’ю.
Відео та деталі заходу: https://bit.ly/4gjriMV
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Ukraine
Під час доповіді відповімо на питання, навіщо потрібно підвищувати продуктивність аплікації і які є найефективніші способи для цього. А також поговоримо про те, що таке кеш, які його види бувають та, основне — як знайти performance bottleneck?
Відео та деталі заходу: https://bit.ly/45tILxj
Ad
More Related Content
Similar to Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets) (20)
Up to MySQL 5.5, replication was not crash safe: it would fail with “dup.key” or “not found” error (or data corruption). So 5.6 is better, right? Maybe: it is possible, but not the default. MySQL 5.7 is not much better, 8.0 has safer defaults but it is still easy to get things wrong.
Crash safety is impacted by positioning (File+Pos or GTID), type (single/multi-threaded), MTS settings (Db/Logical Clock, and preserve commit order), the sync-ing of relay logs, the presence of binlogs, log-slave-updates and their sync-ing. This is complicated and even the manual is confused about it.
In this talk, I will explain above with details on replication internals, so you might learn a thing or two.
This document summarizes concurrency control techniques in database systems. It discusses lock-based protocols, including lock compatibility matrices, two-phase locking, lock conversions, and automatic lock acquisition. It also describes potential issues with locking such as deadlocks and starvation. Implementation of locking involves a lock manager process that maintains a lock table to track granted locks and pending requests.
Database concurrency and transactions - Tal Oliersqlserver.co.il
This document provides an overview of database transactions and locking concepts. It discusses the ACID model which guarantees atomicity, consistency, isolation, and durability. It describes different isolation levels and how they handle phenomena like dirty reads. It also covers locking types including exclusive and share locks. Advanced topics covered include concurrency, lock escalation, and how transactions and locking are implemented differently in Oracle and SQL Server.
The nightmare of locking, blocking and isolation levelsBoris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a nightmare! I also know that you struggle to find some time to go a bit deeper and learn what the various isolation levels can do for you. In this one-hour session, you will be able to see and understand why locking happens, how the locking manager actually works and how can we resolve various locking problems with different techniques ranging from query hints to changing the isolation levels.
Troubleshooting Deadlocks in SQL Server 2000elliando dias
The document discusses deadlocks in SQL Server 2000, including:
1. Deadlocking concepts like lock-based and multi-resource deadlocks.
2. Types of lock deadlocks like single-resource conversion deadlocks and multi-resource exclusive or mixed exclusive-shared deadlocks.
3. Gathering deadlock information in SQL Server like error 1205 and identifying blocking and deadlocked processes.
Long thought to be relegated to the domain of fast, multithreaded desktop applications, race conditions have made their way into web applications. These bugs are often difficult to test for, and are becoming increasingly prevalent due to faster and faster clients, while server-side languages like Node.js and PHP are struggling to keep up. Race conditions are no longer just bugs- when they are found in critical components of web applications, they become a serious security vulnerability. If the proper checks and defensive measures are not in place, databases get confused, “one-time-use” becomes a relative term, and “limited” becomes “unlimited”. This talk will detail specific examples where malicious users could cause damage or profit from a race-condition flaw in a web application. A custom open-source tool will also be introduced to help security researchers and developers easily check for this class of vulnerability in web applications.
MySQL Parallel Replication: inventory, use-cases and limitationsJean-François Gagné
In the last 24 months, MySQL replication speed has improved a lot thanks to implementing parallel replication. MySQL and MariaDB have different types of parallel replication; in this talk, I present in detail the different implementations, with their limitations and the corresponding tuning parameters (covering MySQL 5.6, MariaDB 10.0, MariaDB 10.1 and MySQL 5.7). I also present benchmark results from real Booking.com workloads. Finally, I discuss some deployments at Booking.com that benefits from parallel replication speed improvements.
MySQL 5.7 clustering: The developer perspectiveUlf Wendel
(Compiled from revised slides of previous presentations - skip if you know the old presentations)
A summary on clustering MySQL 5.7 with focus on the PHP clients view and the PHP driver. Which kinds on MySQL clusters are there, what are their goal, how does wich one scale, what extra work does which clustering technique put at the client and finally, how the PHP driver (PECL/mysqlnd_ms) helps you.
The document discusses concepts related to concurrency and multithreading in Java. It defines key terms like threads, locks, and conditions. It explains that threads allow independent tasks to run concurrently for improved performance. Synchronization ensures predictable sharing of memory between threads using monitors, volatile fields provide a lightweight synchronization. Locks provide more flexible locking than synchronized blocks. Conditions can be used to signal between threads waiting on a shared resource like a blocking queue.
Running Galera Cluster in Microsoft Azure involves setting up virtual machines and installing Galera Cluster software. This provides more control than Azure Database for MySQL, which uses asynchronous replication. While Azure Database for MySQL is fully managed, Galera Cluster in VMs supports the virtually synchronous replication that is its core feature. Cost estimates show running three Galera Cluster nodes in VMs costs less monthly than three hosted MySQL instances in Azure Database for MySQL.
MySQL Cluster Asynchronous replication (2014) Frazer Clement
Slides from 2014 describing basic features and implementation of MySQL Cluster asynchronous (binlog) replication, with some monitoring and tuning guidance.
This document discusses concurrency control techniques for transaction processing systems. It covers topics like two-phase locking, lock conversion deadlocks, multigranularity locking, hot spot techniques including partitioning and batching, query-update conflicts resolved through weaker isolation levels or multiversion data, and Oracle's multiversion concurrency control approach.
This document discusses concurrency control techniques for transaction processing systems. It covers topics like two-phase locking, lock conversion deadlocks, multigranularity locking, hot spot techniques including partitioning and batching, query-update conflicts resolved through techniques like multiversion data, and Oracle's multiversion concurrency control approach.
The document discusses different types of locks that can be used for thread synchronization in multi-threaded programming. It describes reentrant locks, read-write locks, stamped locks, spin locks, semaphores, and distributed locks. Distributed locks like RedLock provide safety and liveness guarantees to coordinate access to shared resources across multiple servers.
The nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
This document provides an introduction and overview of key blockchain concepts for developers, including accounts, wallets, transactions, test networks, blockchain clients, and decentralization. It begins with definitions of blockchain accounts, wallets, and transactions. It then discusses the purpose of test networks for blockchain development. It also defines blockchain clients and remote clients and their roles in interacting with blockchain networks. Finally, it discusses the importance of decentralization for blockchains. The document is presented as part of a blockchain solution designer course to provide essential background information for learning blockchain development.
The nightmare of locking, blocking and isolation levelsBoris Hristov
This document discusses transaction locking and isolation levels in SQL Server. It begins with an introduction to locks, their types (shared, update, exclusive), and how they are used for concurrency control. It then covers locking troubleshooting topics like lock escalation, deadlocks, and blocking. The document concludes with an overview of the different transaction isolation levels in SQL Server, including the tradeoffs between pessimistic and optimistic concurrency control approaches.
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Severalnines
This document provides an overview and agenda for a webinar on managing and monitoring MySQL clusters using ClusterControl by Severalnines. The webinar host is introduced and instructions are provided for asking questions. The webinar will cover topics such as operating system configuration, backup strategies, replication, query performance, schema changes, security, reporting, and disaster recovery. Case studies and customers are also briefly mentioned.
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”GlobalLogic Ukraine
Сучасні технічні інтерв’ю можуть викликати хвилювання навіть у досвідчених кандидатів. Вимоги, які постійно зростають, нові інструменти, дедалі жорсткіший відбір — це лише частина викликів. Під час цієї доповіді ви отримаєте відповіді на всі важливі питання щодо підготовки та проходження інтерв’ю.
Відео та деталі заходу: https://bit.ly/4gjriMV
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Ukraine
Під час доповіді відповімо на питання, навіщо потрібно підвищувати продуктивність аплікації і які є найефективніші способи для цього. А також поговоримо про те, що таке кеш, які його види бувають та, основне — як знайти performance bottleneck?
Відео та деталі заходу: https://bit.ly/45tILxj
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Ukraine
Доповідь присвячена медицині майбутнього, малоінвазивній хірургії: розглянемо рішення із використанням роботів хірургів. Оглянемо інструментарій та звернемо увагу на речі, які можна відтворити для експериментів у домашніх умовах.
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Ukraine
Доповідь присвячена розгляду Spring JDBC у порівнянні зі стандартним JDBC у Java. Спікерка покаже на конкретних прикладах розподіл логіки коду за класами та як використання Spring JDBC скорочує кількість коду, який необхідно написати, і чому це відбувається.
Відео та деталі заходу: https://bit.ly/3wqEjCx
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic Ukraine
Ця доповідь зацікавить усіх, хто хоче заповнити прогалини у базових знаннях чи підтягнути теорію з університету. Під час доповіді ми дізнаємось, що таке модель OSI та розглянемо кожен її рівень. Як результат, ви краще розумітимете свою область відповідальності як Front-end, Back-end, DevOps чи системний адміністратор.
Відео та деталі заходу: https://bit.ly/47T4QWI
Штучний інтелект як допомога в навчанні, а не замінник.pptxGlobalLogic Ukraine
Про що лекція:
- Як використовувати штучний інтелект у навчанні
- Обмеження та недоліки використання AI
- Рекомендації щодо відповідального використання AІ в навчанні. Огляд кращих прикладів.
Спікер: Оксана Поморова — Lead Software Engineer, GlobalLogic, доктор технічних наук з 20-річним досвідом в IT. Напрям діяльності — застосування штучного інтелекту та комп’ютерний зір.
Задачі AI-розробника як застосовується штучний інтелект.pptxGlobalLogic Ukraine
Про що лекція:
- Пошук схожих зображень за допомогою ШІ
- Як ШІ видаляє задній фон на фото. Розв’язання задачі сегментації.
- Ефективне навчання ШІ на основі великого масиву даних (фото).
Спікер: Олександр Мірошниченко, Senior Software Engineer, має понад 7 років досвіду в ІТ. Напрям діяльності — нейронні мережі та Deep Learning.
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxGlobalLogic Ukraine
Про що лекція:
- Що таке штучний інтелект зсередини та чим зумовлена його популярність
- Напрями розвитку штучного інтелекту: які є та як обрати свій
- Які знання необхідні, щоб стати розробником штучного інтелекту
Спікер: Василь Ляшкевич — Solution Architect, GlobalLogic, PhD в компʼютерних науках, має понад 15 років досвіду в ІТ. Напрям діяльності — розробка алгоритмів і засобів штучного інтелекту, хмарних систем та сервісів.
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Ukraine
20 липня відбувся вебінар від Java Community – “Zaloni’s Architecture for Data-Driven Design” by Максим Дем’яновський — Software Engineer, GlobalLogic.
Доповідь надасть уявлення про Data-Driven Design, основні його переваги і практичну користь, а також покаже як його можна реалізувати на практиці.
25 квітня відбувся вебінар від JavaScript Community – “Why Is Git Rebase?”
Ганна Ліхтман — Senior Software Engineer, GlobalLogic.
Під час вебінару дізнались, що таке git history, та чому важливо тримати її в чистоті і порядку. Яка різниця між merge та rebase. Що таке інтерактивний rebase та в чому його сила не тільки на словах, але й на практиці.
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic Ukraine
29 березня відбувся вебінар від .NET Community – “Exploring Serverless with Azure Functions”.
Спікер: Євген Павленко – Senior Software Engineer, GlobalLogic.
Поговорили на ті теми:
- Вступ до Azure Functions та Serverless;
- Типи хмарного обчислення;
- Переваги serverless;
- Функції та можливості Azure Functions.
Страх і сила помилок - IT Inside від GlobalLogic EducationGlobalLogic Ukraine
Ви дізнаєтесь:
- Що знаходиться за кулісами успішного успіху;
- Страх, що контролює тебе та робота з ним;
- Звідки береться невпевненість у власних силах;
- Чого власні помилки демотивують.
ℹ️IT Inside — це серія 30-хвилинних лекцій для охочих розпочати кар'єру в ІТ. Наші експерти відкриють залаштунки айтішного життя, обговорять поширені думки про ІТ-сферу й розкажуть те, що самі б хотіли почути на старті кар'єри.
🎬Переглянути записи попередніх лекцій IT Inside (https://youtube.com/playlist?list=PLipGbz33Ay3H5ynlB0YQ6P-16IX-pRvce).
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic Ukraine
24 листопада відбувся вебінар від .NET Community – “Azure RBAC and Managed Identity”.
Спікер: Євген Павленко – Senior Software Engineer, GlobalLogic.
Розповіли, що таке Azure RBAC (Role Base Access Control) і як він працює, для чого нам Azure Managed Identity та як звільнитись від використання паролів-секретів при використанні Azure.
Деталі заходу: https://bit.ly/3GSBvRx
Відкриті .NET-позиції у GlobalLogic: https://bit.ly/3ilJYCq
Долучитись до .NET Community у Facebook: https://www.facebook.com/groups/communitydotnet
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic Ukraine
We considered:
- What attracts you to testing?
- What set of skills does the tester need?
- How to find your niche?
- Truth and fiction about testing
- Resume as a way to success
- Recommended materials
Discussed the capabilities, advantages and disadvantages of Keycloak, made a basic understanding of how it can be applied and integrated into various systems.
Speaker - Ihor Didyk, Software Engineer, GlobalLogic.
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Ukraine
31 травня відбувся вебінар для ML-спеціалістів - “Advanced Statistical Methods for Linear Regression” від спікера Віталія Мірошниченка! Ця доповідь для тих, хто добре ознайомлений із найпоширенішими моделями даних та підходами у машинному навчанні і хоче розширити знання іншими підходами.
У доповіді ми розглянули:
- Нагадування. Модель лінійної регресії і підгонка параметрів;
- Навчання батчами (великі об’єми вибірок);
- Оптимізація розрахунків у каскаді моделей;
- Модель суміші лінійних регресій;
- Оцінки методом складеного ножа матриць коваріацій.
Про спікера:
Віталій Мірошниченко — Senior ML Software Engineer, GlobalLogic. Має більше 6 років досвіду, який отримав здебільшого на проєктах, пов’язаних із Telecom, Cyber security, Retail. Активний учасник змагань Kaggle, та Аспірант КНУ.
Деталі заходу: https://bit.ly/3HkqhDB
Відкриті ML позиції у GlobalLogic: https://bit.ly/3MPC9yo
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Ukraine
24 травня відбувся GlobalLogic Machine Learning Webinar “Statistical learning of linear regression model” від спікера Віталія Мірошніченка.
Під час вебінару ми обговорили такі теми:
- Модель лінійної регресії;
- Підгонка параметрів моделі (custom, sklearn, scipy);
- Основні теореми та асимптотика параметрів;
- Дискриптивні статистики (візуалізація результатів);
- Тести та їх інтерпретація;
- Приклади з Machine Learning.
Відео та деталі заходу - https://www.globallogic.com/ua/about/events/statistical-learning-of-linear-regression-model/?utm_source=youtube-organic&utm_medium=social&utm_campaign=statistical-learning-of-linear-regression-model
Попередня реєстрація на GL BaseCamp - https://bit.ly/BaseCampwaitinglist
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic Ukraine
18 травня відбувся GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer” від спікера Романа Івасишина.
У доповіді ми розглянули:
- Список тем, які повинен знати С++ розробник (синтаксис мови, класи, STL, а також дізнались, для чого вчити темплейти та багатопотоковість);
- На що потрібно звернути увагу при вивченні мови;
- Деякі приховані аспекти мови;
- Практичні приклади з С++.
Відео та деталі заходу: https://bit.ly/3Gxmkee
Приєднатись до спільноти: https://www.facebook.com/groups/EmbeddedCommunity
Відкриті C++ позиції у GlobalLogic: https://bit.ly/3GzW03c
22 лютого відбувся Embedded Webinar #17 “Low-level Network Testing in Embedded Devices Development” від спікера Сергія Корнієнка.
Під час вебінару ми говорили на такі теми:
- Підхід до низькорівневого тестування мережевих протоколів;
- Інструменти, які можна використати в реальних проєктах;
- Знайдені баги та способи знаходження корневих причин на прикладі реального R&D проєкту.
Відео та деталі заходу: https://bit.ly/embedded_webinar_17
Приєднатись до спільноти: https://www.facebook.com/groups/EmbeddedCommunity
Відкриті Embedded-позиції у GlobalLogic: https://bit.ly/Embedded_Positions
11 січня відбувся вебінар “Introduction to Embedded QA”.
Під час вебінару ми поговорили на такі теми:
Огляд вбудованих систем;
Основні складнощі, що виникають під час їх тестування;
Основні напрямки та технології, які необхідно відслідковувати під час роботи з вбудованими системами.
Більше про захід: https://www.globallogic.com/ua/about/events/globallogic-webinar-introduction-to-embedded-qa/
Приємного перегляду і не забудьте залишити коментар про враження від вебінару!
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxJustin Reock
Building 10x Organizations with Modern Productivity Metrics
10x developers may be a myth, but 10x organizations are very real, as proven by the influential study performed in the 1980s, ‘The Coding War Games.’
Right now, here in early 2025, we seem to be experiencing YAPP (Yet Another Productivity Philosophy), and that philosophy is converging on developer experience. It seems that with every new method we invent for the delivery of products, whether physical or virtual, we reinvent productivity philosophies to go alongside them.
But which of these approaches actually work? DORA? SPACE? DevEx? What should we invest in and create urgency behind today, so that we don’t find ourselves having the same discussion again in a decade?
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025BookNet Canada
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, transcript, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...Alan Dix
Talk at the final event of Data Fusion Dynamics: A Collaborative UK-Saudi Initiative in Cybersecurity and Artificial Intelligence funded by the British Council UK-Saudi Challenge Fund 2024, Cardiff Metropolitan University, 29th April 2025
https://alandix.com/academic/talks/CMet2025-AI-Changes-Everything/
Is AI just another technology, or does it fundamentally change the way we live and think?
Every technology has a direct impact with micro-ethical consequences, some good, some bad. However more profound are the ways in which some technologies reshape the very fabric of society with macro-ethical impacts. The invention of the stirrup revolutionised mounted combat, but as a side effect gave rise to the feudal system, which still shapes politics today. The internal combustion engine offers personal freedom and creates pollution, but has also transformed the nature of urban planning and international trade. When we look at AI the micro-ethical issues, such as bias, are most obvious, but the macro-ethical challenges may be greater.
At a micro-ethical level AI has the potential to deepen social, ethnic and gender bias, issues I have warned about since the early 1990s! It is also being used increasingly on the battlefield. However, it also offers amazing opportunities in health and educations, as the recent Nobel prizes for the developers of AlphaFold illustrate. More radically, the need to encode ethics acts as a mirror to surface essential ethical problems and conflicts.
At the macro-ethical level, by the early 2000s digital technology had already begun to undermine sovereignty (e.g. gambling), market economics (through network effects and emergent monopolies), and the very meaning of money. Modern AI is the child of big data, big computation and ultimately big business, intensifying the inherent tendency of digital technology to concentrate power. AI is already unravelling the fundamentals of the social, political and economic world around us, but this is a world that needs radical reimagining to overcome the global environmental and human challenges that confront us. Our challenge is whether to let the threads fall as they may, or to use them to weave a better future.
Mobile App Development Company in Saudi ArabiaSteve Jonas
EmizenTech is a globally recognized software development company, proudly serving businesses since 2013. With over 11+ years of industry experience and a team of 200+ skilled professionals, we have successfully delivered 1200+ projects across various sectors. As a leading Mobile App Development Company In Saudi Arabia we offer end-to-end solutions for iOS, Android, and cross-platform applications. Our apps are known for their user-friendly interfaces, scalability, high performance, and strong security features. We tailor each mobile application to meet the unique needs of different industries, ensuring a seamless user experience. EmizenTech is committed to turning your vision into a powerful digital product that drives growth, innovation, and long-term success in the competitive mobile landscape of Saudi Arabia.
Spark is a powerhouse for large datasets, but when it comes to smaller data workloads, its overhead can sometimes slow things down. What if you could achieve high performance and efficiency without the need for Spark?
At S&P Global Commodity Insights, having a complete view of global energy and commodities markets enables customers to make data-driven decisions with confidence and create long-term, sustainable value. 🌍
Explore delta-rs + CDC and how these open-source innovations power lightweight, high-performance data applications beyond Spark! 🚀
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfAbi john
Analyze the growth of meme coins from mere online jokes to potential assets in the digital economy. Explore the community, culture, and utility as they elevate themselves to a new era in cryptocurrency.
Artificial Intelligence is providing benefits in many areas of work within the heritage sector, from image analysis, to ideas generation, and new research tools. However, it is more critical than ever for people, with analogue intelligence, to ensure the integrity and ethical use of AI. Including real people can improve the use of AI by identifying potential biases, cross-checking results, refining workflows, and providing contextual relevance to AI-driven results.
News about the impact of AI often paints a rosy picture. In practice, there are many potential pitfalls. This presentation discusses these issues and looks at the role of analogue intelligence and analogue interfaces in providing the best results to our audiences. How do we deal with factually incorrect results? How do we get content generated that better reflects the diversity of our communities? What roles are there for physical, in-person experiences in the digital world?
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxAnoop Ashok
In today's fast-paced retail environment, efficiency is key. Every minute counts, and every penny matters. One tool that can significantly boost your store's efficiency is a well-executed planogram. These visual merchandising blueprints not only enhance store layouts but also save time and money in the process.
TrsLabs - Fintech Product & Business ConsultingTrs Labs
Hybrid Growth Mandate Model with TrsLabs
Strategic Investments, Inorganic Growth, Business Model Pivoting are critical activities that business don't do/change everyday. In cases like this, it may benefit your business to choose a temporary external consultant.
An unbiased plan driven by clearcut deliverables, market dynamics and without the influence of your internal office equations empower business leaders to make right choices.
Getting things done within a budget within a timeframe is key to Growing Business - No matter whether you are a start-up or a big company
Talk to us & Unlock the competitive advantage
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Aqusag Technologies
In late April 2025, a significant portion of Europe, particularly Spain, Portugal, and parts of southern France, experienced widespread, rolling power outages that continue to affect millions of residents, businesses, and infrastructure systems.
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, presentation slides, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc
Most consumers believe they’re making informed decisions about their personal data—adjusting privacy settings, blocking trackers, and opting out where they can. However, our new research reveals that while awareness is high, taking meaningful action is still lacking. On the corporate side, many organizations report strong policies for managing third-party data and consumer consent yet fall short when it comes to consistency, accountability and transparency.
This session will explore the research findings from TrustArc’s Privacy Pulse Survey, examining consumer attitudes toward personal data collection and practical suggestions for corporate practices around purchasing third-party data.
Attendees will learn:
- Consumer awareness around data brokers and what consumers are doing to limit data collection
- How businesses assess third-party vendors and their consent management operations
- Where business preparedness needs improvement
- What these trends mean for the future of privacy governance and public trust
This discussion is essential for privacy, risk, and compliance professionals who want to ground their strategies in current data and prepare for what’s next in the privacy landscape.
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Impelsys Inc.
Impelsys provided a robust testing solution, leveraging a risk-based and requirement-mapped approach to validate ICU Connect and CritiXpert. A well-defined test suite was developed to assess data communication, clinical data collection, transformation, and visualization across integrated devices.
Generative Artificial Intelligence (GenAI) in BusinessDr. Tathagat Varma
My talk for the Indian School of Business (ISB) Emerging Leaders Program Cohort 9. In this talk, I discussed key issues around adoption of GenAI in business - benefits, opportunities and limitations. I also discussed how my research on Theory of Cognitive Chasms helps address some of these issues
Technology Trends in 2025: AI and Big Data AnalyticsInData Labs
At InData Labs, we have been keeping an ear to the ground, looking out for AI-enabled digital transformation trends coming our way in 2025. Our report will provide a look into the technology landscape of the future, including:
-Artificial Intelligence Market Overview
-Strategies for AI Adoption in 2025
-Anticipated drivers of AI adoption and transformative technologies
-Benefits of AI and Big data for your business
-Tips on how to prepare your business for innovation
-AI and data privacy: Strategies for securing data privacy in AI models, etc.
Download your free copy nowand implement the key findings to improve your business.
2. 2
Confidential
About me…
• Lead Java Engineer at GlobalLogic
• Overall experience: 11 years
• Has hands-on experience with SQL/NoSQL
DBs
• AWS certified
• Java certified
• Trusted interviewer
3. 3
Confidential
Agenda
• Deadlock definition
• Reasons why deadlocks occur
• Type of SQL locks
• Configuration
• Monitoring
• How to read deadlock dump information
• Deadlock prevention techniques
• Practical examples (demo)
• Q/A
4. 4
Confidential
What is a deadlock?
Deadlock occurs when two or more
tasks permanently block each other
by each task having a lock on a
resource that the other tasks are
trying to lock
6. 6
Confidential
How does deadlock detection works?
There is a process that automatically detects
when a deadlock occurs, and automatically rolls
back one of the transactions involved
(the victim).
deadlock victim
7. 7
Confidential
How does the engine pick the victim?
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.
The size of a transaction is based on factors like:
• The number of rows modified by the transaction.
• The amount of undo log space used by the transaction.
9. 9
Confidential
Are deadlocks dangerous?
“Deadlocks are a classic problem in transactional
databases, but they are not dangerous unless they
are so frequent that you cannot run certain
transactions at all. Normally, you must write your
applications so that they are always prepared to re-
issue a transaction if it gets rolled back because of a
deadlock.” MySQL Reference Manual
So, always be prepared to re-issue a transaction if it
fails due to deadlock. Deadlocks are not dangerous.
Just try again.
10. 10
Confidential
When a deadlock may occur?
“A deadlock can occur when transactions lock rows in multiple tables, but in the
opposite order.
A deadlock can also occur when such statements lock ranges of index records
and gaps, with each transaction acquiring some locks but not others due to a
timing issue.”
MySQL Reference Manual
11. 11
Confidential
What are locks?
Locks in InnoDB provide fine-grained
concurrency control while maintaining
transactional consistency and isolation
across multiple simultaneous transactions.
12. 12
Confidential
Types of locks (InnoDB)
• Record Lock (Row lock): Locks a single row.
• Table Locks: Shared or exclusive locks at the table level.
• Gap Lock: Locks the gap between index records to prevent
inserts.
• Next-Key Lock: A combination of a record lock and a gap lock.
• Auto-Increment Lock: Manages auto-increment values for
inserts.
• Intention Locks (IS/IX): Signals intention to acquire shared
or exclusive row-level locks.
• Insert Intention Lock: Used when inserting rows into a gap.
13. 13
Confidential
How to minimize and handle deadlocks?
1. Do not use DBs
2. Do proper configuration
3. Do proper monitoring
4. Keep you transactions as small as possible
5. Controll the order of your operations
6. Do retries
7. Use less lockings
15. 15
Confidential
Configuration (innodb_print_all_deadlocks)
Fortunately, from mysql 5.5.30 there is a
setting
called innodb_print_all_deadlocks that
helps printing out all deadlocks into mysql
error log. Enabling this does not cause any
downtime.
Note, a simple SHOW ENGINE INNODB
STATUS it shows only the latest deadlock,
which is not very helpful to feel the whole
picture of deadlocks across a period of time.
16. 16
Confidential
Configuration (innodb_deadlock_detect)
This option is used to disable deadlock
detection. On high concurrency systems,
deadlock detection can cause a slowdown
when numerous threads wait for the same
lock. At times, it may be more efficient to
disable deadlock detection and rely on the
innodb_lock_wait_timeout setting for
transaction rollback when a deadlock occurs.
20. 20
Confidential
Useful queries (see latest deadlock)
SHOW ENGINE INNODB STATUS
------------------------
LATEST DETECTED DEADLOCK
------------------------
2024-09-11 07:00:10 22964724647680
*** (1) TRANSACTION:
TRANSACTION 4695804883, ACTIVE 0 sec inserting
Displays operational information about a storage engine, including information about the
latest deadlock.
22. 22
Confidential
Useful queries (get all active locks)
select,
ENGINE_TRANSACTION_ID,
THREAD_ID,
LOCK_TYPE,
LOCK_MODE,
LOCK_STATUS,
LOCK_DATA
from performance_schema.data_locks;
23. 23
Confidential
Tips: Adding comments to your SQLs will safe your time
Marking each SQL query with the unique readable comment will help you to find the needed
query fast.
In case you are using JPA:
Use @Meta annotation Enable comments
24. 24
Confidential
Tips: How to reproduce a deadlock?
Switch to manual transaction
mode
START TRANSACTION (BEGIN);
…
COMMIT;
ROLLBACK;
IDE build-in
feature
Use SQL syntax
29. 29
Confidential
Demo
1. Having one table and having 2 opened
session
2. Demonstrate locking (instead of blocking)
3. Demonstrate blocking
4. Show locks
5. Show deadlock dump
6. Show how to fix it (just preserve the order)
Demo 1 – SQL command line
1. Create an small web app
2. Reproduce deadlock
3. Fix deadlock
4. Cover with the test
Demo 2 – Java app
https://github.com/sergeystets/deadlock
#1: Дякую Ірино.
Вітаю колеги, дякую усім, що приєднались.
Тема у нас сьогодні цікава, хоч і складна. Буду розповідати про дедлоки в SQL. I як обіціяє сам title презитнації я намагатимусь позбавити страхів стосовно дедлоків, та надам достатньо інформації для розуміння.
#2: Класичний слайд про мене…Хто я такий? шо я тут роблю? I чого це мене потрібно взагалі слухати?
На даному етапі я лід в компанії GlobalLogic. Я iз тих лідів, що не тільки люблять тасочки роздать а й трохи покодити. Вважаю себе більше технічною людиной, аніж людиною-менеджером. Але якщо треба щось порішать з точки зору менеджменту, то мені здається, що це в мене також виходить.
Загалом якщо взяти, то у IT сфері з 2013, починав як trainee. Тому я звичайно знаю такі страшні слова як web.xml, jsp, servlet-и, скреплети. Увійшов в IT, коли це ще не було mainstream-м.
Маю наразі AWS сертифікацію.
Сертифікацію по джаві.
Також є трастид інтервьюером. Провожду інтервью для зовнішніх та внутрішніх кандидатів.
#3: Agenda...
Про що ми сьогодні поговоримо?
1. Що таке делок
2. причини дедлоків
3. локи
4. конфігурація
5. монітронг
6. що таке sql dump, як його читати
7. deadlock prevention technics
8. приклади делоків у вигляді демо
9. секція q/a, де можна і треба задавати мені питтаня.
#4: Дедлок виникає тоді, коли два якихось різних потоки (thread-a) перехресно хочуть заволодіти двома різніими обьєктами (чи ресурсами). При тому, перший thread володіє першим обєктом і бажає отримати другой обєкт, а другий thread володіє другим обєктом і бажає володіти першим. І ніхто не хоче поступатися.
#5: Чи трапляються дедлоки в реальному житті? Відповідь – так, звичайно. Перший малюнок (ліворуч), ви могли потенційно бачити, якщо готувались до екзамену по (правилам дорожнього руху) ПДР. Ну це якщо ви здавали цей екзамен. Бо в цілому бути водієм і вчити ПДР, то різні речі Для тих, кто не памятає, то на нерегульованому перехресті у нас діє правило перешкода праворуч. Але в данній ситцації у кожного є така парешкода, тому ми знаходимось у deadlock ситацїї. Яке ж тоді вирішення? Хтось має бути першим, а хтось останнім. Ну а стосовно другої картини, то тут рішення ніякого немає, бо це Київ. Київ це пробки. Просто чекаєш в пробках Що це за ранок без пробок у Києві?
В реальному житті таку ситуацію с трафіком не називають deadlock, a викорстовують спецальний термін: англійскьою він звучить gridlock (або “затор” українською).
Grid lock (image with the cars) - https://en.wikipedia.org/wiki/Gridlock
#6: Повернімося до баз даних.
В базах даних є процес який автоматично виявляє дедлоки і вирішує їх (resolve-ть). Яким чином? Процес обирає одну із транзакцій і відкатує її (rollback), таку транзакцію називають deadlock victim (або жертва).
https://dev.mysql.com/doc/refman/8.4/en/glossary.html#glos_deadlock_detection
#7: Яким чином MySQL InnoDB engine обираю собі жертву? Тобто яка саме тразанкція продовже виконання, а яка буде затермінована? InnoDB обирає найменшу транзакцію. Розмір визначається кількістю рядків, які ми всталяємо, апдейтимо чи видаляємо, а також розміром undo log-a, який викростовує транзакція.
https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlock-detection.html
#8: Чому розробники побоюються deadlock-ів.
....Тому що :)
Якісь причини точно є, наприклад
1. Вони не розуміють чи deadlock це поломка, чи expected behaviour. Чи це погано? Здається, що погано, але наскільки?
2. Не розуміють, як моніторити
3. Як траблшутити/репродюстити
4. Як фіксити
https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlocks-handling.html
#9: Що нам каже документація?
Дедлоки це страшно чи ні?
Каже, що дедлоки це класина проблема системю які мають справу з транзакціями. Вони не є небезпечними, до тих пір поки це не впливає на вашу апку.
В цілому, ви повинні завжди бути гото
https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlocks-handling.html
#10: Коли може виниктути дедлок?
Він може виниктути як уже було сказано в момент, коли різні траназакції блокують рядки в таблиці або в таблицях але у протилежному порядку. (я покажу вам це на прикладі під час демо).
Також дедлок може виниктиту коли транзакції блокуть діапазаони знову ж таки в протилежному порядку.
Тут я виділив пару ключових слів, серед яких є lock (блокування).
https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlocks.html
#11: Ну і перед тим як йти далі, було б непогано згадати, що таке взагалі locks (локи), для чого вони потрібні.
Локи потрібні для того, щоб гарантувати consistency (цілісність) та isolation (ізоляцію), що є частинию принципів ACID (atomacy, consistency, isolation, durability), яким слідує RDBMS.
Хоча ACID необмежена RDBMS і може застосовуватись до любої системи, що працює з транзакціями.
Links:
https://dev.mysql.com/doc/refman/8.4/en/innodb-locking.html
Gap locks deadlock - https://www.youtube.com/watch?v=vYQXpvy1Nm4&ab_channel=RoelVandePaar
#12:
Record Lock (Блокування рядка):
Це блокування застосовується до конкретного рядка у таблиці.
Використовується для запобігання одночасного доступу до одного й того ж рядка під час транзакцій.
Table Locks (Блокування таблиці):
Застосовується на рівні всієї таблиці.
Може бути спільним (shared) або ексклюзивним (exclusive):
Спільне: дозволяє одночасне читання таблиці.
Ексклюзивне: блокує всі операції, окрім тієї, що встановила блокування.
Gap Lock
Блокує проміжки між записами у індексі, щоб запобігти вставкам у ці проміжки.
Використовується для забезпечення узгодженості (consistency) у транзакціях, які потребують повторюваного читання (REPEATABLE READ).
Наприклад, якщо транзакція читає певний діапазон даних, Gap Lock гарантує, що нові записи в цей діапазон не будуть вставлені до завершення транзакції.
Next-Key Lock:
Це комбінація Record Lock та Gap Lock.
Блокує рядок і проміжок перед ним, щоб запобігти вставкам, які могли б порушити порядок у індексі.
Використовується для запобігання фантомним читанням (phantom reads).
Auto-Increment Lock
Управляє значенням автоінкременту під час вставки нових рядків.
Забезпечує унікальність і правильний порядок згенерованих значень.
Це глобальне блокування, яке діє на всю таблицю.
Intention Locks (Інтенційні блокування IS/IX):
Це сигнали про намір отримати спільне або ексклюзивне блокування на рівні рядків.
IS (Intention Shared): транзакція планує отримати спільне блокування на окремих рядках.
IX (Intention Exclusive): транзакція планує отримати ексклюзивне блокування на окремих рядках.
Ці блокування працюють на рівні таблиці та сигналізують про можливі дії, дозволяючи уникнути конфліктів при блокуваннях рядків.
Insert Intention Lock (Блокування наміру вставки):
Використовується під час вставки нового рядка у таблицю.
Блокує проміжок, але не для читання чи оновлення, а щоб запобігти конфлікту між кількома транзакціями, які вставляють у той самий проміжок.
Interesting fact:
It is not recommended to mix locking statements (UPDATE, INSERT, DELETE, or SELECT ... FOR ...) with non-locking SELECT statements in a single REPEATABLE READ transaction, because typically in such cases you want SERIALIZABLE. This is because a non-locking SELECT statement presents the state of the database from a read view which consists of transactions committed before the read view was created, and before the current transaction's own writes, while the locking statements use the most recent state of the database to use locking. In general, these two different table states are inconsistent with each other and difficult to parse.
Links:
https://dev.to/eyo000000/a-straightforward-guide-for-mysql-locks-56i1
#13: https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlocks-handling.html
То як хендлити дедлоки?
Перший пункт не викорстовувати базу даних. Напевно, він нам не підходить.
Якщо без жартів. То перший пункт, я би сказав, це зрозумiти, чи є проблема взагалі. Для цього нам потрібно правильно сконфiгурувати базу даних, щоб мати можливість отримувати детальну iнформацiю про deadlocks. Також нам потрібно налаштувати монiторiнг та alerting.
Стосовно того, як зменишити появу дедлоків, то тут рекомендують, звертати уваги на порядок ваших операцій, бути готовим до того, що траназкцію потрібно повторити, в деяках випадках використовувати менше блокувань.
#16: https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlock-detection.html
https://medium.com/geekculture/how-to-deal-with-deadlocks-in-mysql-58f4d830788b
https://aws.amazon.com/blogs/database/monitor-errors-in-amazon-aurora-mysql-and-amazon-rds-for-mysql-using-amazon-cloudwatch-and-send-notifications-using-amazon-sns/
This option is used to disable deadlock detection. On high concurrency systems, deadlock detection can cause a slowdown when numerous threads wait for the same lock. At times, it may be more efficient to disable deadlock detection and rely on the innodb_lock_wait_timeout setting for transaction rollback when a deadlock occurs. (https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html#sysvar_innodb_deadlock_detect)
#21: https://severalnines.com/blog/understanding-deadlocks-mysql-postgresql/
https://medium.com/geekculture/how-to-deal-with-deadlocks-in-mysql-58f4d830788b
Коли я вперше побачив перед собою такий дамп, я не зовсім чітко розумів, що переді мною, бо він містить досить багато extra інформації, яка скоріше всього не є цінною для вас у плані траблшутінгу.
А також цей дамп містить дуже багато незрозумілих слів
#23: Tips and tricks that are used on our project
https://docs.spring.io/spring-data/jpa/docs/3.1.6/reference/html/
Query:
<update id="update" parameterType="com.myapp.entity.UpdateUserEntity">
/* myapp.user.update */
UPDATE user
SET phone = #{phone}
# ...
WHERE id = #{id}
</update>
SQL Dump:
*** (1) TRANSACTION:
TRANSACTION 450913541522, ACTIVE 0 sec starting index read mysql tables in use 1, locked 1
LOCK WAIT 7 lock structs), heap size 1136, 3 row lock(s), undo log entries 2
MySQL thread id 93608210, OS thread handle 47321957033728,
query id 10802490531 10.0.64.165 db updating /* myapp.user.update */ UPDATE user SET phone = #{phone} WHERE id = 42
#26: https://www.baeldung.com/spring-retry
https://medium.com/@vmoulds01/springboot-retry-random-backoff-136f41a3211a
Please remember to include spring-aop for the retry annotation to work.
#29: https://www.youtube.com/watch?v=3EwDn9hqgkg&ab_channel=SQLBits
DO SLEEP(5); - useful command to emulate hardware slowness
Remember a deadlock may occur even if we have the same order of operations but we touch the same table TWICE.
#33: Дякую усім за увагу, сподіваюсь, що було корисно, будуть питання, або пропозиції, пишіть на пошту.