背景

2019 双十一前走查异常日志,发现有一个死锁日志,现将排查过程记录如下。

排查过程

  1. 查看业务死锁日志,业务代码

全部业务死锁日志如下:

  1. 2019-11-05 15:02:44,990 |0b51153515729373648846445e1bf6| [HSFBizProcessor-DEFAULT-8-thread-47] ERROR c.a.c.c.manager.SessionUserManager - quitSession
  2. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
  3. ### Error updating database. Cause: ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'CCO_XSPACE_SESSION_0003_GROUP' ATOM 'db198205096_cloud_eu126_cco_xspace_session_0003_3417': Deadlock found when trying to get lock; try restarting transaction More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4614]
  4. ### The error may exist in class path resource [mappers/session_users_sqlmap_mapping.xml]
  5. ### The error may involve com.alibaba.cxdc.connected.dao.OcsSessionUserMapper.delete-Inline
  6. ### The error occurred while setting parameters
  7. ### SQL: delete from connected_session_users where sid = ? and user_id = ?
  8. ### Cause: ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'CCO_XSPACE_SESSION_0003_GROUP' ATOM 'db198205096_cloud_eu126_cco_xspace_session_0003_3417': Deadlock found when trying to get lock; try restarting transaction More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4614]
  9. at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
  10. at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
  11. at com.sun.proxy.$Proxy170.delete(Unknown Source)
  12. at org.mybatis.spring.SqlSessionTemplate.delete(SqlSessionTemplate.java:310)
  13. at com.alibaba.cxdc.connected.dao.base.DBCrmDAOBase.switchDelete(DBCrmDAOBase.java:311)
  14. at com.alibaba.cxdc.connected.dao.impl.SessionUserDAOImpl.delete(SessionUserDAOImpl.java:96)
  15. at com.alibaba.cxdc.connected.dao.impl.SessionUserDAOImpl$$FastClassBySpringCGLIB$$24a8bda3.invoke(<generated>)
  16. at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
  17. at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
  18. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
  19. at com.taobao.csp.sentinel.entrypoint.proxy.TraceMethodInterceptor.invoke(TraceMethodInterceptor.java:81)
  20. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  21. at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
  22. at com.alibaba.cxdc.connected.dao.impl.SessionUserDAOImpl$$EnhancerBySpringCGLIB$$5a6023ad.delete(<generated>)
  23. at sun.reflect.GeneratedMethodAccessor1029.invoke(Unknown Source)
  24. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  25. at java.lang.reflect.Method.invoke(Method.java:497)
  26. at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
  27. at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
  28. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
  29. at com.alibaba.cxdc.connected.util.TenantDetectionAop.invoke(TenantDetectionAop.java:52)
  30. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  31. at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
  32. at com.sun.proxy.$Proxy178.delete(Unknown Source)
  33. at com.alibaba.cxdc.connected.manager.ConnectedSessionUserManager.delete(ConnectedSessionUserManager.java:161)
  34. at com.alibaba.cxdc.connected.manager.SessionUserManager.quitSession(SessionUserManager.java:84)
  35. at com.alibaba.cxdc.connected.service.impl.SessionServiceImpl.quitSession(SessionServiceImpl.java:151)
  36. at com.alibaba.cxdc.connected.service.impl.XSpaceSessionUserServiceImpl.updateXSpaceSesionUser(XSpaceSessionUserServiceImpl.java:93)
  37. at com.alibaba.cxdc.connected.service.impl.XSpaceSessionServiceImpl.resumeXSpaceSessionUsersAndHeart(XSpaceSessionServiceImpl.java:1074)
  38. at sun.reflect.GeneratedMethodAccessor1160.invoke(Unknown Source)
  39. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  40. at java.lang.reflect.Method.invoke(Method.java:497)
  41. at com.taobao.csp.sentinel.entrypoint.entrance.HsfProviderInvocationHandler.invoke(HsfProviderInvocationHandler.java:96)
  42. at com.sun.proxy.$Proxy206.resumeXSpaceSessionUsersAndHeart(Unknown Source)
  43. at sun.reflect.GeneratedMethodAccessor1160.invoke(Unknown Source)
  44. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  45. at java.lang.reflect.Method.invoke(Method.java:497)
  46. at com.taobao.hsf.remoting.provider.ReflectInvocationHandler.handleRequest0(ReflectInvocationHandler.java:83)
  47. at com.taobao.hsf.remoting.provider.ReflectInvocationHandler.invoke(ReflectInvocationHandler.java:163)
  48. at com.taobao.hsf2dubbo.DubboServerFilterAsyncInvocationHandlerInterceptor.invoke(DubboServerFilterAsyncInvocationHandlerInterceptor.java:54)
  49. at com.taobao.hsf.filter.FilterInvocationHandler.invoke(FilterInvocationHandler.java:38)
  50. at com.taobao.hsf.invocation.filter.RPCFilterBuilder$TailNode.invoke(RPCFilterBuilder.java:165)
  51. at com.taobao.hsf.debug.DebugServerFilter.invoke(DebugServerFilter.java:25)
  52. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  53. at com.taobao.hsf.common.filter.BidirectionServerResponseFilter.invoke(BidirectionServerResponseFilter.java:15)
  54. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  55. at com.taobao.hsf.unit.service.impl.UnitServerFilter.invoke(UnitServerFilter.java:66)
  56. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  57. at com.taobao.hsf.region.service.impl.RegionServerFilter.invoke(RegionServerFilter.java:42)
  58. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  59. at com.taobao.hsf.plugins.octopus.OctopusServerFilter.invoke(OctopusServerFilter.java:72)
  60. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  61. at com.taobao.hsf.plugins.spas.SpasServerFilter.invoke(SpasServerFilter.java:76)
  62. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  63. at com.taobao.hsf.plugins.txc.TXCServerFilter.invoke(TXCServerFilter.java:35)
  64. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  65. at com.taobao.hsf.tps.component.TPSServerFilter.invoke(TPSServerFilter.java:68)
  66. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  67. at com.taobao.hsf.invocation.stats.InvocationStatsServerFilter.invoke(InvocationStatsServerFilter.java:47)
  68. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  69. at com.taobao.hsf.monitor.log.filter.MonitorLogServerFilter.invoke(MonitorLogServerFilter.java:45)
  70. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  71. at com.taobao.hsf.profiler.ProfilerServerFilter.invoke(ProfilerServerFilter.java:32)
  72. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  73. at com.taobao.hsf.plugins.eagleeye.EagleEyeServerFilter.invoke(EagleEyeServerFilter.java:68)
  74. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  75. at com.taobao.hsf.filter.QosServerFilter.invoke(QosServerFilter.java:60)
  76. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  77. at com.taobao.hsf.rpc.server.MethodAbsenceFilter.invoke(MethodAbsenceFilter.java:48)
  78. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  79. at com.taobao.hsf.rpc.server.EchoFilter.invoke(EchoFilter.java:45)
  80. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  81. at com.taobao.hsf.rpc.generic.GenericInvocationServerFilter.invoke(GenericInvocationServerFilter.java:107)
  82. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  83. at com.taobao.hsf2dubbo.DubboGenericServerFilter.invoke(DubboGenericServerFilter.java:37)
  84. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  85. at com.taobao.hsf.top.TopServerFilter.invoke(TopServerFilter.java:87)
  86. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  87. at com.taobao.hsf.rpc.server.ServiceAbsenceFilter.invoke(ServiceAbsenceFilter.java:47)
  88. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  89. at com.taobao.hsf.common.filter.CommonServerFilter.invoke(CommonServerFilter.java:24)
  90. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  91. at com.taobao.hsf.common.filter.BidirectionServerRequestFilter.invoke(BidirectionServerRequestFilter.java:19)
  92. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  93. at com.taobao.hsf2dubbo.context.DubboRPCContextServerFilter.invoke(DubboRPCContextServerFilter.java:48)
  94. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  95. at com.taobao.hsf.context.RPCContextServerFilter.invoke(RPCContextServerFilter.java:39)
  96. at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71)
  97. at com.taobao.hsf.invocation.filter.RPCFilterBuilder$HeadNode.invoke(RPCFilterBuilder.java:134)
  98. at com.taobao.hsf.invocation.filter.FilterInvocationHandler.invoke(FilterInvocationHandler.java:28)
  99. at com.taobao.hsf.remoting.provider.ServerContextInvocationHandler.invoke(ServerContextInvocationHandler.java:35)
  100. at com.taobao.hsf.remoting.provider.ProviderProcessor.handleRequest(ProviderProcessor.java:70)
  101. at com.taobao.hsf.io.remoting.hsf.message.HSFServerHandler$1.run(HSFServerHandler.java:189)
  102. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  103. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  104. at java.lang.Thread.run(Thread.java:756)
  105. Caused by: org.apache.ibatis.exceptions.PersistenceException:
  106. ### Error updating database. Cause: ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'CCO_XSPACE_SESSION_0003_GROUP' ATOM 'db198205096_cloud_eu126_cco_xspace_session_0003_3417': Deadlock found when trying to get lock; try restarting transaction More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4614]
  107. ### The error may exist in class path resource [mappers/session_users_sqlmap_mapping.xml]
  108. ### The error may involve com.alibaba.cxdc.connected.dao.OcsSessionUserMapper.delete-Inline
  109. ### The error occurred while setting parameters
  110. ### SQL: delete from connected_session_users where sid = ? and user_id = ?
  111. ### Cause: ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'CCO_XSPACE_SESSION_0003_GROUP' ATOM 'db198205096_cloud_eu126_cco_xspace_session_0003_3417': Deadlock found when trying to get lock; try restarting transaction More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4614]
  112. at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
  113. at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
  114. at org.apache.ibatis.session.defaults.DefaultSqlSession.delete(DefaultSqlSession.java:212)
  115. at sun.reflect.GeneratedMethodAccessor985.invoke(Unknown Source)
  116. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  117. at java.lang.reflect.Method.invoke(Method.java:497)
  118. at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
  119. ... 94 common frames omitted
  120. Caused by: com.taobao.tddl.common.exception.TddlRuntimeException: ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'CCO_XSPACE_SESSION_0003_GROUP' ATOM 'db198205096_cloud_eu126_cco_xspace_session_0003_3417': Deadlock found when trying to get lock; try restarting transaction More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4614]
  121. at com.taobao.tddl.repo.mysql.spi.My_JdbcHandler.handleException(My_JdbcHandler.java:1426)
  122. at com.taobao.tddl.repo.mysql.spi.My_JdbcHandler.executeUpdate(My_JdbcHandler.java:1088)
  123. at com.taobao.tddl.repo.mysql.spi.My_Cursor.batchDelete(My_Cursor.java:435)
  124. at com.taobao.tddl.repo.mysql.handler.DeleteMyHandler.executePut(DeleteMyHandler.java:26)
  125. at com.taobao.tddl.repo.mysql.handler.PutMyHandlerCommon.handle(PutMyHandlerCommon.java:27)
  126. at com.taobao.tddl.executor.AbstractGroupExecutor.executeInner(AbstractGroupExecutor.java:47)
  127. at com.taobao.tddl.executor.AbstractGroupExecutor.execByExecPlanNode(AbstractGroupExecutor.java:36)
  128. at com.taobao.tddl.executor.TopologyExecutor.execByExecPlanNode(TopologyExecutor.java:74)
  129. at com.taobao.tddl.executor.MatrixExecutor.execByExecPlanNodeByOne(MatrixExecutor.java:800)
  130. at com.taobao.tddl.executor.MatrixExecutor.execByExecPlanNode(MatrixExecutor.java:789)
  131. at com.taobao.tddl.executor.MatrixExecutor.execute(MatrixExecutor.java:145)
  132. at com.taobao.tddl.matrix.jdbc.TConnection.executeSQL(TConnection.java:275)
  133. at com.taobao.tddl.matrix.jdbc.TPreparedStatement.executeSQL(TPreparedStatement.java:64)
  134. at com.taobao.tddl.matrix.jdbc.TStatement.executeInternal(TStatement.java:142)
  135. at com.taobao.tddl.matrix.jdbc.TPreparedStatement.execute(TPreparedStatement.java:49)
  136. at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
  137. at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
  138. at org.apache.ibatis.executor.ReuseExecutor.doUpdate(ReuseExecutor.java:52)
  139. at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
  140. at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
  141. ... 99 common frames omitted
  142. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
  143. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  144. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  145. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  146. at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
  147. at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
  148. at com.mysql.jdbc.Util.getInstance(Util.java:408)
  149. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
  150. at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
  151. at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
  152. at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
  153. at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
  154. at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
  155. at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
  156. at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
  157. at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
  158. at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)
  159. at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
  160. at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2723)
  161. at com.alibaba.druid.filter.FilterAdapter.preparedStatement_executeUpdate(FilterAdapter.java:1069)
  162. at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:491)
  163. at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2721)
  164. at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeUpdate(PreparedStatementProxyImpl.java:158)
  165. at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:253)
  166. at com.taobao.tddl.atom.jdbc.TPreparedStatementWrapper.executeUpdate(TPreparedStatementWrapper.java:137)
  167. at com.taobao.tddl.group.jdbc.TGroupPreparedStatement.executeUpdateOnConnection(TGroupPreparedStatement.java:132)
  168. at com.taobao.tddl.group.jdbc.TGroupStatement$1.tryOnDataSource(TGroupStatement.java:255)
  169. at com.taobao.tddl.group.jdbc.TGroupStatement$1.tryOnDataSource(TGroupStatement.java:238)
  170. at com.taobao.tddl.group.dbselector.EquityDbManager.tryExecuteInternal(EquityDbManager.java:280)
  171. at com.taobao.tddl.group.dbselector.AbstractDBSelector.tryExecute(AbstractDBSelector.java:442)
  172. at com.taobao.tddl.group.dbselector.AbstractDBSelector.tryExecute(AbstractDBSelector.java:449)
  173. at com.taobao.tddl.group.jdbc.TGroupStatement.executeUpdateInternal(TGroupStatement.java:209)
  174. at com.taobao.tddl.group.jdbc.TGroupStatement.executeUpdate(TGroupStatement.java:171)
  175. at com.taobao.tddl.group.jdbc.TGroupPreparedStatement.executeUpdate(TGroupPreparedStatement.java:102)
  176. at com.taobao.tddl.repo.mysql.spi.My_JdbcHandler.executeUpdate(My_JdbcHandler.java:1011)
  177. ... 117 common frames omitted

可以看到是如下 sql导致了死锁。

  1. delete from connected_session_users where sid = ?

关键调用链如下:

  1. at com.sun.proxy.$Proxy178.delete(Unknown Source)
  2. at com.alibaba.cxdc.connected.manager.ConnectedSessionUserManager.delete(ConnectedSessionUserManager.java:161)
  3. at com.alibaba.cxdc.connected.manager.SessionUserManager.quitSession(SessionUserManager.java:84)
  4. at com.alibaba.cxdc.connected.service.impl.SessionServiceImpl.quitSession(SessionServiceImpl.java:151)
  5. at com.alibaba.cxdc.connected.service.impl.XSpaceSessionUserServiceImpl.updateXSpaceSesionUser(XSpaceSessionUserServiceImpl.java:93)
  6. at com.alibaba.cxdc.connected.service.impl.XSpaceSessionServiceImpl.resumeXSpaceSessionUsersAndHeart(XSpaceSessionServiceImpl.java:1074)

查看业务代码发现并没有使用事务,所以是 一条 sql另一条 sql ,排查难度较大,所以需要进一步获取 mysql 死锁日志进行排查。

  1. 获取 mysql死锁日志,使用
  1. show engine innodb status;

可以查看死锁日志。但是需要在主库上执行该语句,而从 idb 上查询是从备库查,经过与 dba,idb 同学,cloudDBA 同学沟通得到如下信息:

  • 只有 owner 有权限在 idb 上直接查询主库
  • cloudDBA 上的 死锁诊断 功能是无效的,且近期没有支持的打算。

最后在 idb 同学的帮助下获取了死锁日志,如下:

  1. =====================================
  2. 2019-11-07 10:15:20 0x7fccf10ef700 INNODB MONITOR OUTPUT
  3. =====================================
  4. Per second averages calculated from the last 34 seconds
  5. -----------------
  6. BACKGROUND THREAD
  7. -----------------
  8. srv_master_thread loops: 31988258 srv_active, 0 srv_shutdown, 5 srv_idle
  9. srv_master_thread log flush and writes: 31987638
  10. ----------
  11. SEMAPHORES
  12. ----------
  13. OS WAIT ARRAY INFO: reservation count 23203222
  14. OS WAIT ARRAY INFO: reservation count 0
  15. OS WAIT ARRAY INFO: reservation count 21341321
  16. OS WAIT ARRAY INFO: reservation count 0
  17. OS WAIT ARRAY INFO: reservation count 23210338
  18. OS WAIT ARRAY INFO: reservation count 0
  19. OS WAIT ARRAY INFO: reservation count 21337029
  20. OS WAIT ARRAY INFO: reservation count 0
  21. OS WAIT ARRAY INFO: reservation count 23188177
  22. OS WAIT ARRAY INFO: reservation count 0
  23. OS WAIT ARRAY INFO: reservation count 21338727
  24. OS WAIT ARRAY INFO: reservation count 0
  25. OS WAIT ARRAY INFO: reservation count 23198818
  26. OS WAIT ARRAY INFO: reservation count 0
  27. OS WAIT ARRAY INFO: reservation count 21337993
  28. OS WAIT ARRAY INFO: reservation count 0
  29. OS WAIT ARRAY INFO: signal count 231446746
  30. RW-shared spins 0, rounds 542191924, OS waits 142503633
  31. RW-excl spins 0, rounds 1167442614, OS waits 15206489
  32. RW-sx spins 33729319, rounds 379378706, OS waits 6842293
  33. Spin rounds per wait: 542191924.00 RW-shared, 1167442614.00 RW-excl, 11.25 RW-sx
  34. ------------------------
  35. LATEST DETECTED DEADLOCK
  36. ------------------------
  37. 2019-11-05 15:02:44 0x7fcd2caef700
  38. *** (1) TRANSACTION:
  39. TRANSACTION 10476863046, ACTIVE 0 sec starting index read
  40. mysql tables in use 1, locked 1
  41. LOCK WAIT 3 lock struct(s), heap size 1136, 2 row lock(s)
  42. MySQL thread id 3322429, OS thread handle 140493696530176, query id 5089036262 11.18.122.237 cco_xspace_sessi updating
  43. /* 0b51153515729373648846445e1bf6/0.1.1.4.3//e21a688f// */delete from `connected_session_users_0102` where ((`sid` = '65c48fc3bcff47e1ac7a7ce787b2acde') AND (`user_id` = 417880447))
  44. *** (1) HOLDS THE LOCK(S):
  45. RECORD LOCKS space id 132 page no 15896 n bits 416 index idx_sid of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863046 lock_mode X locks rec but not gap
  46. Record lock, heap no 262 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
  47. 0: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  48. 1: len 8; hex 0000000139ee46da; asc 9 F ;;
  49. *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
  50. RECORD LOCKS space id 132 page no 16560 n bits 184 index PRIMARY of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863046 lock_mode X locks rec but not gap waiting
  51. Record lock, heap no 117 PHYSICAL RECORD: n_fields 13; compact format; info bits 32
  52. 0: len 8; hex 0000000139ee46da; asc 9 F ;;
  53. 1: len 6; hex 000270783e47; asc px>G;;
  54. 2: len 7; hex 37002180312260; asc 7 ! 1"`;;
  55. 3: len 5; hex 99a48af04c; asc L;;
  56. 4: len 5; hex 99a48af04c; asc L;;
  57. 5: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  58. 6: len 8; hex 8000000018e8597f; asc Y ;;
  59. 7: len 18; hex e6b3a1e6b2abe4b98be5a48fe5a48fe69cab; asc ;;
  60. 8: len 1; hex 81; asc ;;
  61. 9: len 30; hex 303031326639303133636139336530653030303030303030313665363539; asc 0012f9013ca93e0e0000000016e659; (total 32 bytes);
  62. 10: len 8; hex 0000000000000003; asc ;;
  63. 11: SQL NULL;
  64. 12: SQL NULL;
  65. *** (2) TRANSACTION:
  66. TRANSACTION 10476863047, ACTIVE 0 sec updating or deleting, thread declared inside InnoDB 4999
  67. mysql tables in use 1, locked 1
  68. 3 lock struct(s), heap size 1136, 2 row lock(s), undo log entries 1
  69. MySQL thread id 4294902021, OS thread handle 140519194687232, query id 5089036263 11.178.251.210 drcwriter_shunit updating
  70. DELETE FROM `cco_xspace_session_0003`.`connected_session_users_0102` WHERE `id`=5266884314
  71. *** (2) HOLDS THE LOCK(S):
  72. RECORD LOCKS space id 132 page no 16560 n bits 184 index PRIMARY of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863047 lock_mode X locks rec but not gap
  73. Record lock, heap no 117 PHYSICAL RECORD: n_fields 13; compact format; info bits 32
  74. 0: len 8; hex 0000000139ee46da; asc 9 F ;;
  75. 1: len 6; hex 000270783e47; asc px>G;;
  76. 2: len 7; hex 37002180312260; asc 7 ! 1"`;;
  77. 3: len 5; hex 99a48af04c; asc L;;
  78. 4: len 5; hex 99a48af04c; asc L;;
  79. 5: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  80. 6: len 8; hex 8000000018e8597f; asc Y ;;
  81. 7: len 18; hex e6b3a1e6b2abe4b98be5a48fe5a48fe69cab; asc ;;
  82. 8: len 1; hex 81; asc ;;
  83. 9: len 30; hex 303031326639303133636139336530653030303030303030313665363539; asc 0012f9013ca93e0e0000000016e659; (total 32 bytes);
  84. 10: len 8; hex 0000000000000003; asc ;;
  85. 11: SQL NULL;
  86. 12: SQL NULL;
  87. *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
  88. RECORD LOCKS space id 132 page no 15896 n bits 416 index idx_sid of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863047 lock_mode X locks rec but not gap waiting
  89. Record lock, heap no 262 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
  90. 0: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  91. 1: len 8; hex 0000000139ee46da; asc 9 F ;;
  92. *** WE ROLL BACK TRANSACTION (1)
  93. ------------
  94. TRANSACTIONS
  95. ------------
  96. Trx id counter 10717679978
  97. Purge done for trx's n:o < 10717679978 undo n:o < 0 state: running but idle
  98. History list length 1757
  99. LIST OF TRANSACTIONS FOR EACH SESSION:
  100. ---TRANSACTION 421994453671584, not started
  101. 0 lock struct(s), heap size 1136, 0 row lock(s)
  102. ---TRANSACTION 421994453669600, not started
  103. 0 lock struct(s), heap size 1136, 0 row lock(s)
  104. ---TRANSACTION 421994453665632, not started
  105. 0 lock struct(s), heap size 1136, 0 row lock(s)
  106. ---TRANSACTION 421994453664640, not started
  107. 0 lock struct(s), heap size 1136, 0 row lock(s)
  108. ---TRANSACTION 421994453660672, not started
  109. 0 lock struct(s), heap size 1136, 0 row lock(s)
  110. ---TRANSACTION 421994453656704, not started
  111. 0 lock struct(s), heap size 1136, 0 row lock(s)
  112. ---TRANSACTION 421994453655712, not started
  113. 0 lock struct(s), heap size 1136, 0 row lock(s)
  114. ---TRANSACTION 421994453589248, not started
  115. 0 lock struct(s), heap size 1136, 0 row lock(s)
  116. ---TRANSACTION 421994453587264, not started
  117. 0 lock struct(s), heap size 1136, 0 row lock(s)
  118. ---TRANSACTION 421994453584288, not started
  119. 0 lock struct(s), heap size 1136, 0 row lock(s)
  120. ---TRANSACTION 421994453583296, not started
  121. 0 lock struct(s), heap size 1136, 0 row lock(s)
  122. ---TRANSACTION 421994453580320, not started
  123. 0 lock struct(s), heap size 1136, 0 row lock(s)
  124. ---TRANSACTION 421994453579328, not started
  125. 0 lock struct(s), heap size 1136, 0 row lock(s)
  126. ---TRANSACTION 421994453578336, not started
  127. 0 lock struct(s), heap size 1136, 0 row lock(s)
  128. ---TRANSACTION 421994453572384, not started
  129. 0 lock struct(s), heap size 1136, 0 row lock(s)
  130. ---TRANSACTION 421994453571392, not started
  131. 0 lock struct(s), heap size 1136, 0 row lock(s)
  132. ---TRANSACTION 421994453564448, not started
  133. 0 lock struct(s), heap size 1136, 0 row lock(s)
  134. ---TRANSACTION 421994453563456, not started
  135. 0 lock struct(s), heap size 1136, 0 row lock(s)
  136. ---TRANSACTION 421994453558496, not started
  137. 0 lock struct(s), heap size 1136, 0 row lock(s)
  138. ---TRANSACTION 421994453557504, not started
  139. 0 lock struct(s), heap size 1136, 0 row lock(s)
  140. ---TRANSACTION 421994453552544, not started
  141. 0 lock struct(s), heap size 1136, 0 row lock(s)
  142. ---TRANSACTION 421994453551552, not started
  143. 0 lock struct(s), heap size 1136, 0 row lock(s)
  144. ---TRANSACTION 421994453550560, not started
  145. 0 lock struct(s), heap size 1136, 0 row lock(s)
  146. ---TRANSACTION 421994453545600, not started
  147. 0 lock struct(s), heap size 1136, 0 row lock(s)
  148. ---TRANSACTION 421994453539648, not started
  149. 0 lock struct(s), heap size 1136, 0 row lock(s)
  150. ---TRANSACTION 421994453538656, not started
  151. 0 lock struct(s), heap size 1136, 0 row lock(s)
  152. ---TRANSACTION 421994453537664, not started
  153. 0 lock struct(s), heap size 1136, 0 row lock(s)
  154. ---TRANSACTION 421994453582304, not started
  155. 0 lock struct(s), heap size 1136, 0 row lock(s)
  156. ---TRANSACTION 421994453663648, not started
  157. 0 lock struct(s), heap size 1136, 0 row lock(s)
  158. ---TRANSACTION 421994453704320, not started
  159. 0 lock struct(s), heap size 1136, 0 row lock(s)
  160. ---TRANSACTION 421994453798560, not started
  161. 0 lock struct(s), heap size 1136, 0 row lock(s)
  162. ---TRANSACTION 421994453585280, not started
  163. 0 lock struct(s), heap size 1136, 0 row lock(s)
  164. ---TRANSACTION 421994453792608, not started
  165. 0 lock struct(s), heap size 1136, 0 row lock(s)
  166. ---TRANSACTION 421994453784672, not started
  167. 0 lock struct(s), heap size 1136, 0 row lock(s)
  168. ---TRANSACTION 421994453783680, not started
  169. 0 lock struct(s), heap size 1136, 0 row lock(s)
  170. ---TRANSACTION 421994453780704, not started
  171. 0 lock struct(s), heap size 1136, 0 row lock(s)
  172. ---TRANSACTION 421994453777728, not started
  173. 0 lock struct(s), heap size 1136, 0 row lock(s)
  174. ---TRANSACTION 421994453765824, not started
  175. 0 lock struct(s), heap size 1136, 0 row lock(s)
  176. ---TRANSACTION 421994453757888, not started
  177. 0 lock struct(s), heap size 1136, 0 row lock(s)
  178. ---TRANSACTION 421994453753920, not started
  179. 0 lock struct(s), heap size 1136, 0 row lock(s)
  180. ---TRANSACTION 421994453751936, not started
  181. 0 lock struct(s), heap size 1136, 0 row lock(s)
  182. ---TRANSACTION 421994453746976, not started
  183. 0 lock struct(s), heap size 1136, 0 row lock(s)
  184. ---TRANSACTION 421994453731104, not started
  185. 0 lock struct(s), heap size 1136, 0 row lock(s)
  186. ---TRANSACTION 421994453725152, not started
  187. 0 lock struct(s), heap size 1136, 0 row lock(s)
  188. ---TRANSACTION 421994453720192, not started
  189. 0 lock struct(s), heap size 1136, 0 row lock(s)
  190. ---TRANSACTION 421994453719200, not started
  191. 0 lock struct(s), heap size 1136, 0 row lock(s)
  192. ---TRANSACTION 421994453718208, not started
  193. 0 lock struct(s), heap size 1136, 0 row lock(s)
  194. ---TRANSACTION 421994453717216, not started
  195. 0 lock struct(s), heap size 1136, 0 row lock(s)
  196. ---TRANSACTION 421994453713248, not started
  197. 0 lock struct(s), heap size 1136, 0 row lock(s)
  198. ---TRANSACTION 421994453710272, not started
  199. 0 lock struct(s), heap size 1136, 0 row lock(s)
  200. ---TRANSACTION 421994453707296, not started
  201. 0 lock struct(s), heap size 1136, 0 row lock(s)
  202. ---TRANSACTION 421994453706304, not started
  203. 0 lock struct(s), heap size 1136, 0 row lock(s)
  204. ---TRANSACTION 421994453694400, not started
  205. 0 lock struct(s), heap size 1136, 0 row lock(s)
  206. ---TRANSACTION 421994453693408, not started
  207. 0 lock struct(s), heap size 1136, 0 row lock(s)
  208. ---TRANSACTION 421994453689440, not started
  209. 0 lock struct(s), heap size 1136, 0 row lock(s)
  210. ---TRANSACTION 421994453684480, not started
  211. 0 lock struct(s), heap size 1136, 0 row lock(s)
  212. ---TRANSACTION 421994453680512, not started
  213. 0 lock struct(s), heap size 1136, 0 row lock(s)
  214. ---TRANSACTION 421994453679520, not started
  215. 0 lock struct(s), heap size 1136, 0 row lock(s)
  216. ---TRANSACTION 421994453678528, not started
  217. 0 lock struct(s), heap size 1136, 0 row lock(s)
  218. ---TRANSACTION 421994453674560, not started
  219. 0 lock struct(s), heap size 1136, 0 row lock(s)
  220. ---TRANSACTION 421994453667616, not started
  221. 0 lock struct(s), heap size 1136, 0 row lock(s)
  222. ---TRANSACTION 421994453666624, not started
  223. 0 lock struct(s), heap size 1136, 0 row lock(s)
  224. ---TRANSACTION 421994453662656, not started
  225. 0 lock struct(s), heap size 1136, 0 row lock(s)
  226. ---TRANSACTION 421994453661664, not started
  227. 0 lock struct(s), heap size 1136, 0 row lock(s)
  228. ---TRANSACTION 421994453592224, not started
  229. 0 lock struct(s), heap size 1136, 0 row lock(s)
  230. ---TRANSACTION 421994453591232, not started
  231. 0 lock struct(s), heap size 1136, 0 row lock(s)
  232. ---TRANSACTION 421994453590240, not started
  233. 0 lock struct(s), heap size 1136, 0 row lock(s)
  234. ---TRANSACTION 421994453575360, not started
  235. 0 lock struct(s), heap size 1136, 0 row lock(s)
  236. ---TRANSACTION 421994453573376, not started
  237. 0 lock struct(s), heap size 1136, 0 row lock(s)
  238. ---TRANSACTION 421994453569408, not started
  239. 0 lock struct(s), heap size 1136, 0 row lock(s)
  240. ---TRANSACTION 421994453566432, not started
  241. 0 lock struct(s), heap size 1136, 0 row lock(s)
  242. ---TRANSACTION 421994453560480, not started
  243. 0 lock struct(s), heap size 1136, 0 row lock(s)
  244. ---TRANSACTION 421994453556512, not started
  245. 0 lock struct(s), heap size 1136, 0 row lock(s)
  246. ---TRANSACTION 421994453555520, not started
  247. 0 lock struct(s), heap size 1136, 0 row lock(s)
  248. ---TRANSACTION 421994453547584, not started
  249. 0 lock struct(s), heap size 1136, 0 row lock(s)
  250. ---TRANSACTION 421994453544608, not started
  251. 0 lock struct(s), heap size 1136, 0 row lock(s)
  252. ---TRANSACTION 421994453540640, not started
  253. 0 lock struct(s), heap size 1136, 0 row lock(s)
  254. ---TRANSACTION 421994453536672, not started
  255. 0 lock struct(s), heap size 1136, 0 row lock(s)
  256. ---TRANSACTION 421994453673568, not started
  257. 0 lock struct(s), heap size 1136, 0 row lock(s)
  258. ---TRANSACTION 421994453670592, not started
  259. 0 lock struct(s), heap size 1136, 0 row lock(s)
  260. ---TRANSACTION 421994453781696, not started
  261. 0 lock struct(s), heap size 1136, 0 row lock(s)
  262. ---TRANSACTION 421994453775744, not started
  263. 0 lock struct(s), heap size 1136, 0 row lock(s)
  264. ---TRANSACTION 421994453771776, not started
  265. 0 lock struct(s), heap size 1136, 0 row lock(s)
  266. ---TRANSACTION 421994453769792, not started
  267. 0 lock struct(s), heap size 1136, 0 row lock(s)
  268. ---TRANSACTION 421994453761856, not started
  269. 0 lock struct(s), heap size 1136, 0 row lock(s)
  270. ---TRANSACTION 421994453758880, not started
  271. 0 lock struct(s), heap size 1136, 0 row lock(s)
  272. ---TRANSACTION 421994453730112, not started
  273. 0 lock struct(s), heap size 1136, 0 row lock(s)
  274. ---TRANSACTION 421994453722176, not started
  275. 0 lock struct(s), heap size 1136, 0 row lock(s)
  276. ---TRANSACTION 421994453714240, not started
  277. 0 lock struct(s), heap size 1136, 0 row lock(s)
  278. ---TRANSACTION 421994453697376, not started
  279. 0 lock struct(s), heap size 1136, 0 row lock(s)
  280. ---TRANSACTION 421994453695392, not started
  281. 0 lock struct(s), heap size 1136, 0 row lock(s)
  282. ---TRANSACTION 421994453686464, not started
  283. 0 lock struct(s), heap size 1136, 0 row lock(s)
  284. ---TRANSACTION 421994453682496, not started
  285. 0 lock struct(s), heap size 1136, 0 row lock(s)
  286. ---TRANSACTION 421994453677536, not started
  287. 0 lock struct(s), heap size 1136, 0 row lock(s)
  288. ---TRANSACTION 421994453676544, not started
  289. 0 lock struct(s), heap size 1136, 0 row lock(s)
  290. ---TRANSACTION 421994453594208, not started
  291. 0 lock struct(s), heap size 1136, 0 row lock(s)
  292. ---TRANSACTION 421994453593216, not started
  293. 0 lock struct(s), heap size 1136, 0 row lock(s)
  294. ---TRANSACTION 421994453588256, not started
  295. 0 lock struct(s), heap size 1136, 0 row lock(s)
  296. ---TRANSACTION 421994453577344, not started
  297. 0 lock struct(s), heap size 1136, 0 row lock(s)
  298. ---TRANSACTION 421994453574368, not started
  299. 0 lock struct(s), heap size 1136, 0 row lock(s)
  300. ---TRANSACTION 421994453565440, not started
  301. 0 lock struct(s), heap size 1136, 0 row lock(s)
  302. ---TRANSACTION 421994453561472, not started
  303. 0 lock struct(s), heap size 1136, 0 row lock(s)
  304. ---TRANSACTION 421994453554528, not started
  305. 0 lock struct(s), heap size 1136, 0 row lock(s)
  306. ---TRANSACTION 421994453543616, not started
  307. 0 lock struct(s), heap size 1136, 0 row lock(s)
  308. ---TRANSACTION 421994453534688, not started
  309. 0 lock struct(s), heap size 1136, 0 row lock(s)
  310. ---TRANSACTION 421994453721184, not started
  311. 0 lock struct(s), heap size 1136, 0 row lock(s)
  312. ---TRANSACTION 421994453794592, not started
  313. 0 lock struct(s), heap size 1136, 0 row lock(s)
  314. ---TRANSACTION 421994453790624, not started
  315. 0 lock struct(s), heap size 1136, 0 row lock(s)
  316. ---TRANSACTION 421994453787648, not started
  317. 0 lock struct(s), heap size 1136, 0 row lock(s)
  318. ---TRANSACTION 421994453776736, not started
  319. 0 lock struct(s), heap size 1136, 0 row lock(s)
  320. ---TRANSACTION 421994453770784, not started
  321. 0 lock struct(s), heap size 1136, 0 row lock(s)
  322. ---TRANSACTION 421994453764832, not started
  323. 0 lock struct(s), heap size 1136, 0 row lock(s)
  324. ---TRANSACTION 421994453750944, not started
  325. 0 lock struct(s), heap size 1136, 0 row lock(s)
  326. ---TRANSACTION 421994453748960, not started
  327. 0 lock struct(s), heap size 1136, 0 row lock(s)
  328. ---TRANSACTION 421994453747968, not started
  329. 0 lock struct(s), heap size 1136, 0 row lock(s)
  330. ---TRANSACTION 421994453743008, not started
  331. 0 lock struct(s), heap size 1136, 0 row lock(s)
  332. ---TRANSACTION 421994453715232, not started
  333. 0 lock struct(s), heap size 1136, 0 row lock(s)
  334. ---TRANSACTION 421994453702336, not started
  335. 0 lock struct(s), heap size 1136, 0 row lock(s)
  336. ---TRANSACTION 421994453700352, not started
  337. 0 lock struct(s), heap size 1136, 0 row lock(s)
  338. ---TRANSACTION 421994453672576, not started
  339. 0 lock struct(s), heap size 1136, 0 row lock(s)
  340. ---TRANSACTION 421994453654720, not started
  341. 0 lock struct(s), heap size 1136, 0 row lock(s)
  342. ---TRANSACTION 421994453581312, not started
  343. 0 lock struct(s), heap size 1136, 0 row lock(s)
  344. ---TRANSACTION 421994453535680, not started
  345. 0 lock struct(s), heap size 1136, 0 row lock(s)
  346. ---TRANSACTION 421994453548576, not started
  347. 0 lock struct(s), heap size 1136, 0 row lock(s)
  348. ---TRANSACTION 421994453675552, not started
  349. 0 lock struct(s), heap size 1136, 0 row lock(s)
  350. ---TRANSACTION 421994453546592, not started
  351. 0 lock struct(s), heap size 1136, 0 row lock(s)
  352. ---TRANSACTION 421994453755904, not started
  353. 0 lock struct(s), heap size 1136, 0 row lock(s)
  354. ---TRANSACTION 421994453739040, not started
  355. 0 lock struct(s), heap size 1136, 0 row lock(s)
  356. ---TRANSACTION 421994453692416, not started
  357. 0 lock struct(s), heap size 1136, 0 row lock(s)
  358. ---TRANSACTION 421994453586272, not started
  359. 0 lock struct(s), heap size 1136, 0 row lock(s)
  360. ---TRANSACTION 421994453549568, not started
  361. 0 lock struct(s), heap size 1136, 0 row lock(s)
  362. ---TRANSACTION 421994453779712, not started
  363. 0 lock struct(s), heap size 1136, 0 row lock(s)
  364. ---TRANSACTION 421994453773760, not started
  365. 0 lock struct(s), heap size 1136, 0 row lock(s)
  366. ---TRANSACTION 421994453709280, not started
  367. 0 lock struct(s), heap size 1136, 0 row lock(s)
  368. ---TRANSACTION 421994453701344, not started
  369. 0 lock struct(s), heap size 1136, 0 row lock(s)
  370. ---TRANSACTION 421994453657696, not started
  371. 0 lock struct(s), heap size 1136, 0 row lock(s)
  372. ---TRANSACTION 421994453782688, not started
  373. 0 lock struct(s), heap size 1136, 0 row lock(s)
  374. ---TRANSACTION 421994453658688, not started
  375. 0 lock struct(s), heap size 1136, 0 row lock(s)
  376. ---TRANSACTION 421994453559488, not started
  377. 0 lock struct(s), heap size 1136, 0 row lock(s)
  378. ---TRANSACTION 421994453756896, not started
  379. 0 lock struct(s), heap size 1136, 0 row lock(s)
  380. ---TRANSACTION 421994453752928, not started
  381. 0 lock struct(s), heap size 1136, 0 row lock(s)
  382. ---TRANSACTION 421994453727136, not started
  383. 0 lock struct(s), heap size 1136, 0 row lock(s)
  384. ---TRANSACTION 421994453699360, not started
  385. 0 lock struct(s), heap size 1136, 0 row lock(s)
  386. ---TRANSACTION 421994453690432, not started
  387. 0 lock struct(s), heap size 1136, 0 row lock(s)
  388. ---TRANSACTION 421994453688448, not started
  389. 0 lock struct(s), heap size 1136, 0 row lock(s)
  390. ---TRANSACTION 421994453681504, not started
  391. 0 lock struct(s), heap size 1136, 0 row lock(s)
  392. ---TRANSACTION 421994453668608, not started
  393. 0 lock struct(s), heap size 1136, 0 row lock(s)
  394. ---TRANSACTION 421994453659680, not started
  395. 0 lock struct(s), heap size 1136, 0 row lock(s)
  396. ---TRANSACTION 421994453568416, not started
  397. 0 lock struct(s), heap size 1136, 0 row lock(s)
  398. ---TRANSACTION 421994453763840, not started
  399. 0 lock struct(s), heap size 1136, 0 row lock(s)
  400. ---TRANSACTION 421994453576352, not started
  401. 0 lock struct(s), heap size 1136, 0 row lock(s)
  402. ---TRANSACTION 421994453542624, not started
  403. 0 lock struct(s), heap size 1136, 0 row lock(s)
  404. ---TRANSACTION 421994453541632, not started
  405. 0 lock struct(s), heap size 1136, 0 row lock(s)
  406. ---TRANSACTION 421994453653728, not started
  407. 0 lock struct(s), heap size 1136, 0 row lock(s)
  408. ---TRANSACTION 421994453652736, not started
  409. 0 lock struct(s), heap size 1136, 0 row lock(s)
  410. ---TRANSACTION 421994453651744, not started
  411. 0 lock struct(s), heap size 1136, 0 row lock(s)
  412. ---TRANSACTION 421994453650752, not started
  413. 0 lock struct(s), heap size 1136, 0 row lock(s)
  414. ---TRANSACTION 421994453649760, not started
  415. 0 lock struct(s), heap size 1136, 0 row lock(s)
  416. ---TRANSACTION 421994453648768, not started
  417. 0 lock struct(s), heap size 1136, 0 row lock(s)
  418. ---TRANSACTION 421994453647776, not started
  419. 0 lock struct(s), heap size 1136, 0 row lock(s)
  420. ---TRANSACTION 421994453646784, not started
  421. 0 lock struct(s), heap size 1136, 0 row lock(s)
  422. ---TRANSACTION 421994453645792, not started
  423. 0 lock struct(s), heap size 1136, 0 row lock(s)
  424. ---TRANSACTION 421994453644800, not started
  425. 0 lock struct(s), heap size 1136, 0 row lock(s)
  426. ---TRANSACTION 421994453643808, not started
  427. 0 lock struct(s), heap size 1136, 0 row lock(s)
  428. ---TRANSACTION 421994453642816, not started
  429. 0 lock struct(s), heap size 1136, 0 row lock(s)
  430. ---TRANSACTION 421994453641824, not started
  431. 0 lock struct(s), heap size 1136, 0 row lock(s)
  432. ---TRANSACTION 421994453640832, not started
  433. 0 lock struct(s), heap size 1136, 0 row lock(s)
  434. ---TRANSACTION 421994453639840, not started
  435. 0 lock struct(s), heap size 1136, 0 row lock(s)
  436. ---TRANSACTION 421994453638848, not started
  437. 0 lock struct(s), heap size 1136, 0 row lock(s)
  438. ---TRANSACTION 421994453637856, not started
  439. 0 lock struct(s), heap size 1136, 0 row lock(s)
  440. ---TRANSACTION 421994453636864, not started
  441. 0 lock struct(s), heap size 1136, 0 row lock(s)
  442. ---TRANSACTION 421994453635872, not started
  443. 0 lock struct(s), heap size 1136, 0 row lock(s)
  444. ---TRANSACTION 421994453634880, not started
  445. 0 lock struct(s), heap size 1136, 0 row lock(s)
  446. ---TRANSACTION 421994453633888, not started
  447. 0 lock struct(s), heap size 1136, 0 row lock(s)
  448. ---TRANSACTION 421994453632896, not started
  449. 0 lock struct(s), heap size 1136, 0 row lock(s)
  450. ---TRANSACTION 421994453631904, not started
  451. 0 lock struct(s), heap size 1136, 0 row lock(s)
  452. ---TRANSACTION 421994453630912, not started
  453. 0 lock struct(s), heap size 1136, 0 row lock(s)
  454. ---TRANSACTION 421994453629920, not started
  455. 0 lock struct(s), heap size 1136, 0 row lock(s)
  456. ---TRANSACTION 421994453628928, not started
  457. 0 lock struct(s), heap size 1136, 0 row lock(s)
  458. ---TRANSACTION 421994453627936, not started
  459. 0 lock struct(s), heap size 1136, 0 row lock(s)
  460. ---TRANSACTION 421994453626944, not started
  461. 0 lock struct(s), heap size 1136, 0 row lock(s)
  462. ---TRANSACTION 421994453625952, not started
  463. 0 lock struct(s), heap size 1136, 0 row lock(s)
  464. ---TRANSACTION 421994453624960, not started
  465. 0 lock struct(s), heap size 1136, 0 row lock(s)
  466. ---TRANSACTION 421994453623968, not started
  467. 0 lock struct(s), heap size 1136, 0 row lock(s)
  468. ---TRANSACTION 421994453621984, not started
  469. 0 lock struct(s), heap size 1136, 0 row lock(s)
  470. ---TRANSACTION 421994453620992, not started
  471. 0 lock struct(s), heap size 1136, 0 row lock(s)
  472. ---TRANSACTION 421994453620000, not started
  473. 0 lock struct(s), heap size 1136, 0 row lock(s)
  474. ---TRANSACTION 421994453610080, not started
  475. 0 lock struct(s), heap size 1136, 0 row lock(s)
  476. ---TRANSACTION 421994453609088, not started
  477. 0 lock struct(s), heap size 1136, 0 row lock(s)
  478. ---TRANSACTION 421994453608096, not started
  479. 0 lock struct(s), heap size 1136, 0 row lock(s)
  480. ---TRANSACTION 421994453607104, not started
  481. 0 lock struct(s), heap size 1136, 0 row lock(s)
  482. ---TRANSACTION 421994453606112, not started
  483. 0 lock struct(s), heap size 1136, 0 row lock(s)
  484. ---TRANSACTION 421994453605120, not started
  485. 0 lock struct(s), heap size 1136, 0 row lock(s)
  486. ---TRANSACTION 421994453604128, not started
  487. 0 lock struct(s), heap size 1136, 0 row lock(s)
  488. ---TRANSACTION 421994453603136, not started
  489. 0 lock struct(s), heap size 1136, 0 row lock(s)
  490. ---TRANSACTION 421994453602144, not started
  491. 0 lock struct(s), heap size 1136, 0 row lock(s)
  492. ---TRANSACTION 421994453601152, not started
  493. 0 lock struct(s), heap size 1136, 0 row lock(s)
  494. ---TRANSACTION 421994453600160, not started
  495. 0 lock struct(s), heap size 1136, 0 row lock(s)
  496. ---TRANSACTION 421994453599168, not started
  497. 0 lock struct(s), heap size 1136, 0 row lock(s)
  498. ---TRANSACTION 421994453598176, not started
  499. 0 lock struct(s), heap size 1136, 0 row lock(s)
  500. ---TRANSACTION 421994453597184, not started
  501. 0 lock struct(s), heap size 1136, 0 row lock(s)
  502. ---TRANSACTION 421994453596192, not started
  503. 0 lock struct(s), heap size 1136, 0 row lock(s)
  504. ---TRANSACTION 421994453595200, not started
  505. 0 lock struct(s), heap size 1136, 0 row lock(s)
  506. ---TRANSACTION 421994453570400, not started
  507. 0 lock struct(s), heap size 1136, 0 row lock(s)
  508. ---TRANSACTION 421994453567424, not started
  509. 0 lock struct(s), heap size 1136, 0 row lock(s)
  510. ---TRANSACTION 421994453562464, not started
  511. 0 lock struct(s), heap size 1136, 0 row lock(s)
  512. ---TRANSACTION 421994453553536, not started
  513. 0 lock struct(s), heap size 1136, 0 row lock(s)
  514. ---TRANSACTION 10717679987, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  515. mysql tables in use 1, locked 1
  516. 0 lock struct(s), heap size 1136, 0 row lock(s)
  517. MySQL thread id 4294902044, OS thread handle 140493710145280, query id 5218226974 11.178.251.210 drcwriter_shunit updating
  518. UPDATE `cco_xspace_session_0002`.`xspace_session_heart_check_0095` SET `last_heart_time`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' WHERE `id`=5498433091
  519. ---TRANSACTION 10717679986, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  520. mysql tables in use 1, locked 1
  521. 0 lock struct(s), heap size 1136, 0 row lock(s)
  522. MySQL thread id 4294902042, OS thread handle 140514616604416, query id 5218226973 11.178.251.210 drcwriter_shunit updating
  523. UPDATE `cco_xspace_session_0003`.`xspace_chat_robot_client_0125` SET `gmt_modified`='2019-11-07 10:15:20' , `status`=0 WHERE `id`=1762275607
  524. ---TRANSACTION 10717679985, ACTIVE 0 sec inserting, thread declared inside InnoDB 5000
  525. mysql tables in use 1, locked 1
  526. 0 lock struct(s), heap size 1136, 0 row lock(s)
  527. MySQL thread id 4294902048, OS thread handle 140509053966080, query id 5218226972 11.178.251.210 drcwriter_shunit update
  528. INSERT IGNORE INTO `cco_xspace_session_0002`.`xspace_chat_robot_log_0083` SET `id`=4899842401 , `gmt_create`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' , `robot_id`=2 , `operater`=0 , `event`=CONVERT('{\"sid\": \"542214075eec4e878ac34f353f9c7355\", \"action\": \"init\", \"speech\": \"\", \"status\": 0, \"robotId\": 2, \"traceId\": \"0b16f58c15730929197795684d08c5\", \"servicerId\": 16704135, \"changeSource\": \"xspace\", \"channel_type\": \"OCS\", \"robotSessionId\": 1767584842}',JSON) , `operation`=_utf8mb4'send_robot_status' , `sid`=_utf8mb4'542214075eec4e878ac34f353f9c7355
  529. ---TRANSACTION 10717679984, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  530. mysql tables in use 1, locked 1
  531. 0 lock struct(s), heap size 1136, 0 row lock(s)
  532. MySQL thread id 4294902041, OS thread handle 140520123766528, query id 5218226971 11.178.251.210 drcwriter_shunit updating
  533. UPDATE `cco_xspace_session_0002`.`xspace_session_heart_check_0076` SET `last_heart_time`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' WHERE `id`=5492066907
  534. ---TRANSACTION 10717679983, ACTIVE 0 sec inserting, thread declared inside InnoDB 5000
  535. mysql tables in use 1, locked 1
  536. 0 lock struct(s), heap size 1136, 0 row lock(s)
  537. MySQL thread id 4294902043, OS thread handle 140515195418368, query id 5218226970 11.178.251.210 drcwriter_shunit update
  538. INSERT IGNORE INTO `cco_xspace_session_0002`.`xspace_chat_robot_log_0083` SET `id`=4899842400 , `gmt_create`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' , `robot_id`=2 , `operater`=0 , `event`=CONVERT('{\"sid\": \"542214075eec4e878ac34f353f9c7355\", \"action\": \"sys_end\", \"speech\": \"\", \"status\": -1, \"robotId\": 2, \"traceId\": \"0b16f58c15730929197795684d08c5\", \"servicerId\": 16704135, \"changeSource\": \"xspace\", \"channel_type\": \"OCS\", \"robotSessionId\": 1767584841}',JSON) , `operation`=_utf8mb4'send_robot_status' , `sid`=_utf8mb4'542214075eec4e878ac34f353f9c
  539. ---TRANSACTION 10717679982, ACTIVE 0 sec inserting, thread declared inside InnoDB 5000
  540. mysql tables in use 1, locked 1
  541. 0 lock struct(s), heap size 1136, 0 row lock(s)
  542. MySQL thread id 4294902040, OS thread handle 140518339049216, query id 5218226969 11.178.251.210 drcwriter_shunit update
  543. INSERT IGNORE INTO `cco_xspace_session_0002`.`xspace_chat_robot_log_0083` SET `id`=4899842399 , `gmt_create`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' , `robot_id`=2 , `operater`=0 , `event`=CONVERT('{\"sid\": \"542214075eec4e878ac34f353f9c7355\", \"action\": \"init\", \"speech\": \"\", \"status\": 0, \"robotId\": 2, \"traceId\": \"0b16f58c15730929197795684d08c5\", \"servicerId\": 16704135, \"changeSource\": \"xspace\", \"channel_type\": \"OCS\", \"robotSessionId\": 1767584841}',JSON) , `operation`=_utf8mb4'send_robot_status' , `sid`=_utf8mb4'542214075eec4e878ac34f353f9c7355
  544. ---TRANSACTION 10717679981, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  545. mysql tables in use 1, locked 1
  546. 0 lock struct(s), heap size 1136, 0 row lock(s)
  547. MySQL thread id 4294902037, OS thread handle 140510619432704, query id 5218226967 11.178.251.210 drcwriter_shunit updating
  548. DELETE FROM `cco_xspace_session_0003`.`xspace_session_heart_check_0127` WHERE `id`=5498081814
  549. ---TRANSACTION 10717679980, ACTIVE 0 sec inserting, thread declared inside InnoDB 5000
  550. mysql tables in use 1, locked 1
  551. 0 lock struct(s), heap size 1136, 0 row lock(s)
  552. MySQL thread id 4294902039, OS thread handle 140509237450496, query id 5218226968 11.178.251.210 drcwriter_shunit update
  553. INSERT IGNORE INTO `cco_xspace_session_0002`.`xspace_chat_robot_client_0083` SET `id`=1767584841 , `gmt_create`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' , `robot_id`=2 , `sid`=_utf8mb4'542214075eec4e878ac34f353f9c7355' , `status`=0 , `start_time`='2019-11-07 10:15:20' , `end_time`=NULL , `service_id`=16704135 , `service_buid`=NULL , `tenant_id`=3 , `member_id`=2206653888825 , `department_id`=250 , `group_id`=56038
  554. ---TRANSACTION 10717679979, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  555. mysql tables in use 1, locked 1
  556. 0 lock struct(s), heap size 1136, 0 row lock(s)
  557. MySQL thread id 4294902036, OS thread handle 140520070309632, query id 5218226966 11.178.251.210 drcwriter_shunit updating
  558. UPDATE `cco_xspace_session_0003`.`xspace_session_heart_check_0114` SET `last_heart_time`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' WHERE `id`=5492354321
  559. ---TRANSACTION 10717679978, ACTIVE 0 sec starting index read, thread declared inside InnoDB 5000
  560. mysql tables in use 1, locked 1
  561. 0 lock struct(s), heap size 1136, 0 row lock(s)
  562. MySQL thread id 4294902038, OS thread handle 140519669733120, query id 5218226965 11.178.251.210 drcwriter_shunit updating
  563. UPDATE `cco_xspace_session_0003`.`xspace_session_heart_check_0100` SET `last_heart_time`='2019-11-07 10:15:20' , `gmt_modified`='2019-11-07 10:15:20' WHERE `id`=5498113695
  564. --------
  565. FILE I/O
  566. --------
  567. I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
  568. I/O thread 1 state: waiting for completed aio requests (log thread)
  569. I/O thread 2 state: waiting for completed aio requests (read thread)
  570. I/O thread 3 state: waiting for completed aio requests (read thread)
  571. I/O thread 4 state: waiting for completed aio requests (read thread)
  572. I/O thread 5 state: waiting for completed aio requests (read thread)
  573. I/O thread 6 state: waiting for completed aio requests (read thread)
  574. I/O thread 7 state: waiting for completed aio requests (read thread)
  575. I/O thread 8 state: waiting for completed aio requests (read thread)
  576. I/O thread 9 state: waiting for completed aio requests (read thread)
  577. I/O thread 10 state: waiting for completed aio requests (write thread)
  578. I/O thread 11 state: waiting for completed aio requests (write thread)
  579. I/O thread 12 state: waiting for completed aio requests (write thread)
  580. I/O thread 13 state: waiting for completed aio requests (write thread)
  581. I/O thread 14 state: waiting for completed aio requests (write thread)
  582. I/O thread 15 state: waiting for completed aio requests (write thread)
  583. I/O thread 16 state: waiting for completed aio requests (write thread)
  584. I/O thread 17 state: waiting for completed aio requests (write thread)
  585. Pending normal aio reads: [0, 0, 0, 0, 0, 0, 0, 0] , aio writes: [0, 0, 0, 0, 0, 0, 0, 0] ,
  586. ibuf aio reads:, log i/o's:, sync i/o's:
  587. Pending flushes (fsync) log: 0; buffer pool: 0
  588. 422118905 OS file reads, 5266550419 OS file writes, 671873711 OS fsyncs
  589. 88.35 reads/s, 16384 avg bytes/read, 786.57 writes/s, 208.96 fsyncs/s
  590. -------------------------------------
  591. INSERT BUFFER AND ADAPTIVE HASH INDEX
  592. -------------------------------------
  593. Ibuf: size 1, free list len 0, seg size 2, 0 merges
  594. merged operations:
  595. insert 0, delete mark 0, delete 0
  596. discarded operations:
  597. insert 0, delete mark 0, delete 0
  598. Hash table size 2212699, node heap has 114 buffer(s)
  599. Hash table size 2212699, node heap has 63 buffer(s)
  600. Hash table size 2212699, node heap has 46 buffer(s)
  601. Hash table size 2212699, node heap has 13 buffer(s)
  602. Hash table size 2212699, node heap has 34 buffer(s)
  603. Hash table size 2212699, node heap has 81 buffer(s)
  604. Hash table size 2212699, node heap has 79 buffer(s)
  605. Hash table size 2212699, node heap has 98 buffer(s)
  606. 266.85 hash searches/s, 2031.85 non-hash searches/s
  607. ---
  608. LOG
  609. ---
  610. Log sequence number 5238953570974
  611. Log flushed up to 5238953192067
  612. Pages flushed up to 5238895690211
  613. Last checkpoint at 5238893392118
  614. 0 pending log flushes, 0 pending chkp writes
  615. 4119025225 log i/o's done, 397.76 log i/o's/second
  616. ----------------------
  617. BUFFER POOL AND MEMORY
  618. ----------------------
  619. Total large memory allocated 8795455488
  620. Dictionary memory allocated 639935871
  621. Buffer pool size 524288
  622. Free buffers 8099
  623. Database pages 515661
  624. Old database pages 190270
  625. Modified db pages 52049
  626. Pending reads 1
  627. Pending writes: LRU 0, flush list 0, single page 0
  628. Pages made young 550672254, not young 3566705046
  629. 79.97 youngs/s, 153.88 non-youngs/s
  630. Pages read 422105577, created 44129950, written 1146979024
  631. 88.35 reads/s, 5.97 creates/s, 388.81 writes/s
  632. Buffer pool hit rate 998 / 1000, young-making rate 2 / 1000 not 4 / 1000
  633. Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
  634. LRU len: 515661, unzip_LRU len: 0
  635. I/O sum[96400]:cur[188], unzip sum[0]:cur[0]
  636. ----------------------
  637. INDIVIDUAL BUFFER POOL INFO
  638. ----------------------
  639. ---BUFFER POOL 0
  640. Buffer pool size 131072
  641. Free buffers 2024
  642. Database pages 128912
  643. Old database pages 47567
  644. Modified db pages 15418
  645. Pending reads 1
  646. Pending writes: LRU 0, flush list 0, single page 0
  647. Pages made young 151501569, not young 916988519
  648. 25.47 youngs/s, 39.85 non-youngs/s
  649. Pages read 110844585, created 12359044, written 286949498
  650. 22.88 reads/s, 1.44 creates/s, 97.20 writes/s
  651. Buffer pool hit rate 999 / 1000, young-making rate 1 / 1000 not 2 / 1000
  652. Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
  653. LRU len: 128912, unzip_LRU len: 0
  654. I/O sum[24100]:cur[47], unzip sum[0]:cur[0]
  655. ---BUFFER POOL 1
  656. Buffer pool size 131072
  657. Free buffers 2024
  658. Database pages 128912
  659. Old database pages 47566
  660. Modified db pages 12382
  661. Pending reads 0
  662. Pending writes: LRU 0, flush list 0, single page 0
  663. Pages made young 133859239, not young 882471366
  664. 17.79 youngs/s, 36.62 non-youngs/s
  665. Pages read 103654470, created 10585375, written 286673730
  666. 21.85 reads/s, 1.79 creates/s, 97.20 writes/s
  667. Buffer pool hit rate 988 / 1000, young-making rate 10 / 1000 not 20 / 1000
  668. Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
  669. LRU len: 128912, unzip_LRU len: 0
  670. I/O sum[24100]:cur[47], unzip sum[0]:cur[0]
  671. ---BUFFER POOL 2
  672. Buffer pool size 131072
  673. Free buffers 2032
  674. Database pages 128912
  675. Old database pages 47566
  676. Modified db pages 11913
  677. Pending reads 0
  678. Pending writes: LRU 0, flush list 0, single page 0
  679. Pages made young 129400012, not young 884558406
  680. 17.50 youngs/s, 39.94 non-youngs/s
  681. Pages read 102960280, created 10586551, written 286660470
  682. 21.03 reads/s, 1.15 creates/s, 97.20 writes/s
  683. Buffer pool hit rate 987 / 1000, young-making rate 11 / 1000 not 25 / 1000
  684. Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
  685. LRU len: 128912, unzip_LRU len: 0
  686. I/O sum[24100]:cur[47], unzip sum[0]:cur[0]
  687. ---BUFFER POOL 3
  688. Buffer pool size 131072
  689. Free buffers 2019
  690. Database pages 128925
  691. Old database pages 47571
  692. Modified db pages 12336
  693. Pending reads 0
  694. Pending writes: LRU 0, flush list 0, single page 0
  695. Pages made young 135911434, not young 882686755
  696. 19.21 youngs/s, 37.47 non-youngs/s
  697. Pages read 104646242, created 10598980, written 286695326
  698. 22.59 reads/s, 1.59 creates/s, 97.20 writes/s
  699. Buffer pool hit rate 998 / 1000, young-making rate 2 / 1000 not 4 / 1000
  700. Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
  701. LRU len: 128925, unzip_LRU len: 0
  702. I/O sum[24100]:cur[47], unzip sum[0]:cur[0]
  703. --------------
  704. ROW OPERATIONS
  705. --------------
  706. 10 queries inside InnoDB, 0 queries in queue
  707. 0 read views open inside InnoDB
  708. Process ID=55859, Main thread ID=140509127366400, state: sleeping
  709. Number of rows inserted 1165447625, updated 2799376983, deleted 600012204, read 15629490844
  710. 143.35 inserts/s, 281.84 updates/s, 28.12 deletes/s, 330.49 reads/s
  711. ----------------------------
  712. END OF INNODB MONITOR OUTPUT
  713. ============================

关键日志如下:

  1. ------------------------
  2. LATEST DETECTED DEADLOCK
  3. ------------------------
  4. 2019-11-05 15:02:44 0x7fcd2caef700
  5. *** (1) TRANSACTION:
  6. TRANSACTION 10476863046, ACTIVE 0 sec starting index read
  7. mysql tables in use 1, locked 1
  8. LOCK WAIT 3 lock struct(s), heap size 1136, 2 row lock(s)
  9. MySQL thread id 3322429, OS thread handle 140493696530176, query id 5089036262 11.18.122.237 cco_xspace_sessi updating
  10. /* 0b51153515729373648846445e1bf6/0.1.1.4.3//e21a688f// */delete from `connected_session_users_0102` where ((`sid` = '65c48fc3bcff47e1ac7a7ce787b2acde') AND (`user_id` = 417880447))
  11. *** (1) HOLDS THE LOCK(S):
  12. RECORD LOCKS space id 132 page no 15896 n bits 416 index idx_sid of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863046 lock_mode X locks rec but not gap
  13. Record lock, heap no 262 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
  14. 0: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  15. 1: len 8; hex 0000000139ee46da; asc 9 F ;;
  16. *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
  17. RECORD LOCKS space id 132 page no 16560 n bits 184 index PRIMARY of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863046 lock_mode X locks rec but not gap waiting
  18. Record lock, heap no 117 PHYSICAL RECORD: n_fields 13; compact format; info bits 32
  19. 0: len 8; hex 0000000139ee46da; asc 9 F ;;
  20. 1: len 6; hex 000270783e47; asc px>G;;
  21. 2: len 7; hex 37002180312260; asc 7 ! 1"`;;
  22. 3: len 5; hex 99a48af04c; asc L;;
  23. 4: len 5; hex 99a48af04c; asc L;;
  24. 5: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  25. 6: len 8; hex 8000000018e8597f; asc Y ;;
  26. 7: len 18; hex e6b3a1e6b2abe4b98be5a48fe5a48fe69cab; asc ;;
  27. 8: len 1; hex 81; asc ;;
  28. 9: len 30; hex 303031326639303133636139336530653030303030303030313665363539; asc 0012f9013ca93e0e0000000016e659; (total 32 bytes);
  29. 10: len 8; hex 0000000000000003; asc ;;
  30. 11: SQL NULL;
  31. 12: SQL NULL;
  32. *** (2) TRANSACTION:
  33. TRANSACTION 10476863047, ACTIVE 0 sec updating or deleting, thread declared inside InnoDB 4999
  34. mysql tables in use 1, locked 1
  35. 3 lock struct(s), heap size 1136, 2 row lock(s), undo log entries 1
  36. MySQL thread id 4294902021, OS thread handle 140519194687232, query id 5089036263 11.178.251.210 drcwriter_shunit updating
  37. DELETE FROM `cco_xspace_session_0003`.`connected_session_users_0102` WHERE `id`=5266884314
  38. *** (2) HOLDS THE LOCK(S):
  39. RECORD LOCKS space id 132 page no 16560 n bits 184 index PRIMARY of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863047 lock_mode X locks rec but not gap
  40. Record lock, heap no 117 PHYSICAL RECORD: n_fields 13; compact format; info bits 32
  41. 0: len 8; hex 0000000139ee46da; asc 9 F ;;
  42. 1: len 6; hex 000270783e47; asc px>G;;
  43. 2: len 7; hex 37002180312260; asc 7 ! 1"`;;
  44. 3: len 5; hex 99a48af04c; asc L;;
  45. 4: len 5; hex 99a48af04c; asc L;;
  46. 5: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  47. 6: len 8; hex 8000000018e8597f; asc Y ;;
  48. 7: len 18; hex e6b3a1e6b2abe4b98be5a48fe5a48fe69cab; asc ;;
  49. 8: len 1; hex 81; asc ;;
  50. 9: len 30; hex 303031326639303133636139336530653030303030303030313665363539; asc 0012f9013ca93e0e0000000016e659; (total 32 bytes);
  51. 10: len 8; hex 0000000000000003; asc ;;
  52. 11: SQL NULL;
  53. 12: SQL NULL;
  54. *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
  55. RECORD LOCKS space id 132 page no 15896 n bits 416 index idx_sid of table `cco_xspace_session_0003`.`connected_session_users_0102` trx id 10476863047 lock_mode X locks rec but not gap waiting
  56. Record lock, heap no 262 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
  57. 0: len 30; hex 363563343866633362636666343765316163376137636537383762326163; asc 65c48fc3bcff47e1ac7a7ce787b2ac; (total 32 bytes);
  58. 1: len 8; hex 0000000139ee46da; asc 9 F ;;
  59. *** WE ROLL BACK TRANSACTION (1)

死锁日志分析:

  1. 获取隔离级别(备库)

    1. # sql
    2. select @@tx_isolation,@@global.tx_isolation;
    3. # 结果
    4. @@tx_isolation @@global.tx_isolation
    5. READ-COMMITTED READ-COMMITTED
    6. # 可以看到是 rc 隔离级别
  2. 查看表结构,获取表上索引信息(主备一致)

    1. id 为 primary
    2. sid 为 normal 索引(非唯一索引)
  3. 获取 mysql 版本(备库)
  1. # sql
  2. select version();
  3. # 结果
  4. 5.7.14.5-AliSQL-X-Cluster-1.4.1.12-20190912-log

事务 A:delete from connected_session_users_0102 where ((sid = ‘65c48fc3bcff47e1ac7a7ce787b2acde’) AND (user_id = 417880447))
事务 B:DELETE FROM cco_xspace_session_0003.connected_session_users_0102 WHERE id=5266884314

序号 事务 A 事务 B
1 获取 sid 上的 写 锁
2 获取 id 上的写锁
3 尝试获取 id 上的写锁(失败)
4 尝试获取 sid 上的 写 锁

其中第 3 步和第 4 步形成死锁。
疑惑:

  1. 事务 A 持有 sid 锁,获取 id 锁我理解,但是事务 B 持有 id 锁,去获取 sid 锁我不理解。

死锁重现

  1. docker 安装 mysql
  1. # 下载镜像
  2. docker pull mysql:5.7
  3. # 启动 mysql
  4. docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
  5. # 进入 mysql 容器内部,使其可以被外网查询
  6. docker exec -it mysql bash
  7. # 以下为在 mysql 容器内部执行的命令
  8. # 登陆 mysql
  9. mysql -uroot -p123456
  10. # 设置远程连接
  11. grant all privileges on *.* to root@'%'identified by '123456';
  12. flush privileges;
  13. exit
  1. 创建测试表
  1. CREATE DATABASE if not EXISTS pfjia;
  2. use pfjia;
  3. DROP TABLE IF EXISTS `test`;
  4. CREATE TABLE IF NOT EXISTS `test`(
  5. `id` int(11) DEFAULT NULL,
  6. `sid` varchar(50) DEFAULT NULL,
  7. KEY `idx_sid`(`sid`)
  8. ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4;
  1. 插入测试数据(通过脚本插入 1000 条数据)
  1. insert into test values(?,?);
  2. # 示例 sql
  3. insert into test values(1,'1');
  1. 开启 innodb_lock_monitor (用来查看一条语句执行时的加锁信息)
  1. # 5.6 及以前的方式
  2. use pfjia;
  3. create table innodb_lock_monitor(x int) engine=innodb;
  4. # 5.7 及以后的方式
  5. use pfjia;
  6. SET GLOBAL innodb_status_output_locks=ON;
  7. # 详情在 google 搜索关键字“innodb_lock_monitor”,选择不同版本的 mysql Reference Manual
  1. 修改事务隔离级别(因为此版本的 mysql 的默认隔离级别是 rr,需修改为 rc)
  1. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  2. SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1. 重建连接,check 事务隔离级别是否被修改
  1. # sql
  2. select @@tx_isolation,@@global.tx_isolation;
  3. # 结果
  4. @@tx_isolation @@global.tx_isolation
  5. READ-COMMITTED READ-COMMITTED
  6. # 可以看到是事务隔离级别已被修改为 rc
  1. 根据 sid 删除数据
  1. begin;
  2. delete from test where sid='55';
  1. 查看 innodb status
  1. # sql
  2. show engine innodb status;
  3. # 关键结果
  4. ---TRANSACTION 2843, ACTIVE 1161 sec
  5. 3 lock struct(s), heap size 1136, 2 row lock(s), undo log entries 1
  6. MySQL thread id 8, OS thread handle 140293095675648, query id 2251 42.120.74.114 root
  7. TABLE LOCK table `pfjia`.`test` trx id 2843 lock mode IX
  8. RECORD LOCKS space id 25 page no 8 n bits 1064 index idx_sid of table `pfjia`.`test` trx id 2843 lock_mode X locks rec but not gap
  9. Record lock, heap no 291 PHYSICAL RECORD: n_fields 2; compact format; info bits 32
  10. 0: len 2; hex 3336; asc 36;;
  11. 1: len 6; hex 000000000223; asc #;;
  12. RECORD LOCKS space id 25 page no 5 n bits 528 index GEN_CLUST_INDEX of table `pfjia`.`test` trx id 2843 lock_mode X locks rec but not gap
  13. Record lock, heap no 37 PHYSICAL RECORD: n_fields 5; compact format; info bits 32
  14. 0: len 6; hex 000000000223; asc #;;
  15. 1: len 6; hex 000000000b1b; asc ;;
  16. 2: len 7; hex 29000001cc0110; asc ) ;;
  17. 3: len 4; hex 80000024; asc $;;
  18. 4: len 2; hex 3336; asc 36;;