当前位置:网站首页>MySQL write lock does not take effect
MySQL write lock does not take effect
2022-07-24 15:54:00 【Nie Bingyu】
1. background
Need to verify : Program query mylsq Whether the execution process after failure meets expectations .
Procedures to be tested :1. From time to time mysql Read data from ;2. The program has configured read-write timeout .
Verification process :
After the program starts , Add write lock , Next query mysql It should have failed , Will execute the failed process . After adding write lock , It can also read data correctly .
2. Lock / Unlock
Lock :
- locak table ‘table’ [read|write]
Unlock :
- unlock tables
3. Cause of failure
Performance after locking :
- Regular reading of data in the program is normal
- Current window terminal , Can query data
- Newly opened terminal , Query data blocking
In terms of performance 1 and 2 Before locking, there are from db Read data in ,3 Start reading data after locking . Speculation is related to caching .
Query found open cache :
MariaDB> show variables like "%query_cache%";
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| have_query_cache | YES |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 33554432 |
| query_cache_strip_comments | OFF |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
+------------------------------+----------+
The cache will expire after the data is updated , Update the table data , Program timing query failed , In line with expectations .
4. summary
When the table needs to be locked for verification , If the data can be read after locking , The reason for the invalidation may be related to opening the cache . terms of settlement , perform update or insert Update the table .
边栏推荐
- 【ACWing】909. 下棋游戏
- 基于Lambert函数的时滞系统稳定性研究
- Who is the "roll" king of the prefabricated vegetable track?
- 在LAMP架构中部署Zabbix监控系统及邮件报警机制
- 应用修改日志路径log4j.properties
- 狗牙根植物介绍
- Personal practical experience: Data Modeling "whether account data belongs to dimension or account domain"
- 降噪蓝牙耳机哪个好?性价比最高的降噪蓝牙耳机排行
- 22 bracket generation
- How to deal with being attacked? Advanced anti DDoS IP protection strategy
猜你喜欢

【TA-霜狼_may-《百人计划》】图形3.4 延迟渲染管线介绍

YOLO5Face:为什么要重新发明人脸检测器

Leetcode 223. rectangular area

Adaptive design and responsive design

JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue

torch_ How to use scatter. Scatter() in detail

Windows10安装免安装版redis

【SWT】滚动容器实现商品列表样式

MySQL之知识点(十二)

Dynamics 365: how to get the authentication information required to connect to D365 online from azure
随机推荐
From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?
You can't just focus on flex layout and elaborate animation to explain all flex layout methods! Easy to understand dry goods tutorial
Dynamics 365: how to get the threshold value of executemullerequest in batch requests
【洛谷】P1908 逆序对
Lsyncd 实时同步
华为无线设备配置WAPI-证书安全策略
【TA-霜狼_may-《百人计划》】图形3.4 延迟渲染管线介绍
在LAMP架构中部署Zabbix监控系统及邮件报警机制
Application modification log path log4j.properties
Kubernetes static storage and dynamic storage
Yolov4 trains its own data set
Arduino ide esp32 firmware installation and upgrade tutorial
R language ggplot2 visualization: ggplot2 visualization basic scatter plot, through in theme_ Specify the parameter base in BW_ Size to change the size of axis labels and control the size of gridlines
Public and private key transmission, and understanding of CA certificate
Citic securities account opening process, is it safe to open an account on your mobile phone
Fine tune layoutlm V3 for bill data processing and content recognition
G026-db-gs-ins-03 openeuler deployment opengauss (1 active and 2 standby or multiple standby)
[SWT] scrolling container to realize commodity list style
2022 / 7 / 20 training record
收益率在百分之六以上的理财产品,请说一下