当前位置:网站首页>GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析
GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析
2022-06-27 19:33:00 【生命之源;】
在GBase 8a里,create database是权限最高的DDL语句,其需要一个db_lock独占锁,如果其它SQL在使用该库,则需要等待,从现象看是被卡住了。即使运行create database if not exists一样要等待锁。
现象
如下的一个create database语句,已经等待了130秒没有返回。
最后用户取消了,显示信息如下:
可以看到是无法拿到锁,取消了等待锁的操作。
排查
再次运行create database语句,然后执行gcadmin showlock,查看集群锁的情况
可以看到IP为12节点的401398进程(下面的2个红框),没有拿到db_lock的锁(FALSE),该锁被IP为14的254505拿到了。连接14节点,查看进程
发现该节点的进程正在做insert select操作,且已经执行了3266秒。
解决
等待该SQL完成
确认该业务不重要,kill掉
人工确认数据库已存在,不要运行create database语句
总结
create database一般都是运行在系统初始化阶段,在业务升级时,是不需要重建数据库的。而在业务升级时,涉及到【重建】库,肯定要先停掉现有业务,才能操作,也不会出现这个现象。
所以,除了初始化,其它的业务升级,不要包含create database 语句。
边栏推荐
- Tiktok's interest in e-commerce has hit the traffic ceiling?
- 集合代码练习
- Acwing周赛57-数字操作-(思维+分解质因数)
- CORBA 架构体系指南(通用对象请求代理体系架构)
- Is it safe to open an account and buy stocks? Who knows
- 图解基于AQS队列实现的CountDownLatch和CyclicBarrier
- 100 important knowledge points for SQL: in operator
- AI painting minimalist tutorial
- Go from introduction to actual combat -- channel closing and broadcasting (notes)
- Go从入门到实战——任务的取消(笔记)
猜你喜欢
今晚战码先锋润和赛道第2期直播丨如何参与OpenHarmony代码贡献
Go from entry to practice - multiple selection and timeout control (notes)
∫(0→1) ln(1+x) / (x ² + 1) dx
Industry case | see the operation of bank digital transformation from the king of retail
VMware vSphere esxi 7.0 installation tutorial
Squid proxy server
AI 绘画极简教程
Go从入门到实战——接口(笔记)
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
熊市慢慢,Bit.Store提供稳定Staking产品助你穿越牛熊
随机推荐
MySQL performance optimization index function, hidden, prefix, hash index usage (2)
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
Industry case | see the operation of bank digital transformation from the king of retail
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
Go从入门到实战——依赖管理(笔记)
GBase 8a OLAP函数group by grouping sets的使用样例
MySQL usage notes 1
Go从入门到实战——所有任务完成(笔记)
Go from introduction to actual combat - all tasks completed (notes)
Save method of JPA stepping pit series
Go from starting to Real - Interface (note)
如何将队列里面的内容没秒钟执行一次优先级
Go from entry to practice - multiple selection and timeout control (notes)
100 important knowledge points that SQL must master: using functions to process data
MySQL client tools are recommended. I can't imagine that it is best to use Juran
SQL必需掌握的100个重要知识点:检索数据
IO stream code
Go从入门到实战——channel的关闭和广播(笔记)
Go从入门到实战——多态(笔记)
SQL必需掌握的100个重要知识点:组合 WHERE 子句