In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
When the system crashes, it is found that there are no committed transactions, and some operations will be rolled back.
(1) begin; select from t where id in the first window
< 7; ->1 3 5
(2) in the second window begin; insert into t values (2); commit
(3) select from t where id in the first window
< 7; ->1 3 5 commit; changes the current transaction isolation level
Set sesstion tx_isolation='read-committed'; (read submitted)
Select from t where id < 7; 1 3 5 2
(4) in the second window begin; insert into t values (4); commit
(5) in the first window select from t where id < 7; 1 3 5 2 4
The fourth isolation level
Serializable serializable has the highest isolation level, and every row of data read is locked, resulting in a large number of lock timeouts, so this isolation level is rarely used, with isolation from low to high and concurrency from high to low.
Innodb default isolation level is repeatable
What is a big deal?
Define transactions that take a long time to run and operate more data
Risk:
1 locking too much data, causing a lot of blocking and lock timeout
2 the rollback takes a long time and execution time, which is easy to cause master-slave delay.
3 if the transaction of the master database is executed for several hours and then committed, it will be written to the binlog, and the binlog log will be read from the slave database before synchronization begins.
4 innodb is a row-level lock, which is equivalent to locking the entire table when all records are involved
How to deal with big affairs
1 avoid dealing with too much data at once
2 remove unnecessary select operations in the transaction
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.