网站建设知识
mycat分页慢原理解析、mycat跨事务解惑、mycat注解调用存储过程分析
2025-07-22 09:57  点击:0

1结合Mycat日志,分析select * from travelrecord order by id limit100000,100 的执行过程,解释下当limit M,N中的M非常大的情况下,为什么查询结果会变慢很多

1.1mycat控制命令台显示,explain出来走了所有的节点

         mysql>explain select * from travelrecord order by id limit 100000,100 ;         +-----------+--------------------------------------------------------+         |DATA_NODE | SQL                                                   |         +-----------+--------------------------------------------------------+         |dn1       | SELECT * FROM travelrecordORDER BY id LIMIT 0, 100100 |         |dn2       | SELECT * FROM travelrecordORDER BY id LIMIT 0, 100100 |         |dn3       | SELECT * FROM travelrecordORDER BY id LIMIT 0, 100100 |         +-----------+--------------------------------------------------------+         3rows in set (0.01 sec)         mysql>

1.2看后台mycat.log日志:

         02/1417:52:30.103  DEBUG [$_NIOREACTOR-0-RW](ServerQueryHandler.java:56) -ServerConnection [id=3, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]explainselect * from travelrecord order by id limit 1000000,100         02/1417:52:30.103  DEBUG [$_NIOREACTOR-0-RW](EnchachePool.java:76) -SQLRouteCache miss cache ,key:TESTDB select * from travelrecord order by id limit1000000,100         02/1417:52:30.105  DEBUG [$_NIOREACTOR-0-RW] (EnchachePool.java:59)-SQLRouteCache add cache ,key:TESTDB select * from travelrecord order by idlimit 1000000,100 value:select * from travelrecord order by id limit1000000,100, route={            1 -> dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            2 -> dn2{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            3 -> dn3{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}         }         02/1417:52:33.880  DEBUG [$_NIOREACTOR-0-RW](ServerQueryHandler.java:56) -ServerConnection [id=3, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]select* from travelrecord order by id limit 1000000,100         02/1417:52:33.881  DEBUG [$_NIOREACTOR-0-RW](EnchachePool.java:76) -SQLRouteCache miss cache ,key:TESTDBselect * from travelrecord order by id limit1000000,100         02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](EnchachePool.java:59) -SQLRouteCache add cache ,key:TESTDBselect * fromtravelrecord order by id limit 1000000,100 value:select * from travelrecordorder by id limit 1000000,100, route={            1 -> dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            2 -> dn2{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            3 -> dn3{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}         }        02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](NonBlockingSession.java:113) -ServerConnection [id=3, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]select* from travelrecord order by id limit 1000000,100, route={            1 -> dn1{SELECT *         FROMtravelrecord         ORDERBY id        02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](NonBlockingSession.java:113) -ServerConnection [id=3, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]select* from travelrecord order by id limit 1000000,100, route={            1 -> dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            2 -> dn2{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}            3 -> dn3{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}         }rrs         02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:82) -execute mutinode query select * from travelrecordorder by id limit 1000000,100         02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:97) -has data merge logic         02/1417:52:33.882  DEBUG [$_NIOREACTOR-0-RW](PhysicalDBPool.java:452) -select read source hostM1 for dataHost:wgq_idc_mon_1_12         02/1417:52:33.883  DEBUG [$_NIOREACTOR-0-RW](PhysicalDBPool.java:452) -select read source hostM1 fordataHost:wgq_idc_mon_1_12         02/1417:52:33.883  DEBUG [$_NIOREACTOR-0-RW](PhysicalDBPool.java:452) -select read source hostM1 for dataHost:wgq_idc_mon_1_12         02/1417:52:33.883  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=19, lastTime=1455443553868, user=root, schema=db1, oldshema=db1, borrowed=true, fromSlaveDB=false, threadId=220, charset=latin1,txIsolation=3, autocommit=true, attachment=dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@b47af37,writeQueue=0, modifiedSQLExecuted=false]         02/1417:52:33.884  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:241) -on row end reseponse MySQLConnection [id=25,lastTime=1455443553868, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=227, charset=latin1, txIsolation=3,autocommit=true, attachment=dn3{SELECT *         FROMtravelrecord         02/1417:52:33.883  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=19, lastTime=1455443553868, user=root, schema=db1, oldshema=db1, borrowed=true, fromSlaveDB=false, threadId=220, charset=latin1,txIsolation=3, autocommit=true, attachment=dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@b47af37,writeQueue=0, modifiedSQLExecuted=false]         02/1417:52:33.884  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:241) -on row end reseponse MySQLConnection [id=25,lastTime=1455443553868, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=227, charset=latin1, txIsolation=3,autocommit=true, attachment=dn3{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=false]        02/1417:52:33.884  DEBUG [$_NIOREACTOR-3-RW](DataMergeService.java:94) -field metadata inf:[ID=Colmeta [colIndex=0,colType=8], DAYS=Colmeta [colIndex=4, colType=3], TRAVELDATE=Colmeta[colIndex=2, colType=10], USER_ID=Colmeta [colIndex=1, colType=253],FEE=Colmeta [colIndex=3, colType=246]]         02/1417:52:33.884  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=25,lastTime=1455443553868, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=227, charset=latin1, txIsolation=3,autocommit=true, attachment=dn3{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=false]        02/1417:52:33.885  DEBUG [$_NIOREACTOR-1-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=25,lastTime=1455443553868, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=227, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/1417:52:33.886  DEBUG [$_NIOREACTOR-3-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=19,lastTime=1455443553868, user=root, schema=db1, old shema=db1, borrowed=true,fromSlaveDB=false, threadId=220, charset=latin1, txIsolation=3,autocommit=true, attachment=dn1{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100}, respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@b47af37,writeQueue=0, modifiedSQLExecuted=false]        02/1417:52:33.886  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=19,lastTime=1455443553868, user=root, schema=db1, old shema=db1, borrowed=true,fromSlaveDB=false, threadId=220, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111, port=3317,statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/1417:52:33.886  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:241) -on row end reseponse MySQLConnection [id=42,lastTime=1455443553868, user=root, schema=db2, old shema=db2, borrowed=true,fromSlaveDB=false, threadId=234, charset=latin1, txIsolation=3,autocommit=true, attachment=dn2{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=false]         02/1417:52:33.886  DEBUG [$_NIOREACTOR-3-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=42,lastTime=1455443553868, user=root, schema=db2, old shema=db2, borrowed=true,fromSlaveDB=false, threadId=234, charset=latin1, txIsolation=3,autocommit=true, attachment=dn2{SELECT *         FROMtravelrecord         ORDERBY id         LIMIT0, 1000100},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@f35a686, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]        02/1417:52:33.886  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=42,lastTime=1455443553868, user=root, schema=db2, old shema=db2, borrowed=true,fromSlaveDB=false, threadId=234, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/1417:52:33.887  DEBUG [BusinessExecutor5](DataMergeService.java:296) -prepare mpp merge result for select * fromtravelrecord order by id limit 1000000,100         02/1417:52:33.887  DEBUG [BusinessExecutor5](MultiNodeQueryHandler.java:324) -last packet id:8

路由里面是先查limit 0,1000000条,然后再查出limit 0,1000100条记录,在这个基础上查出100条(prepare mpp mergeresult for select * from travelrecord order by id limit 1000000,100),所以如果这个M=1000000越来越大,一次性拉的数据就越大,这样就越来越慢了,那么需要查询的数据就比较多


2结合Mycat日志,分析跨分片事务的执行过程,以一个正常的跨分片SQL的事务过程,以及,一个错误SQL为例(比如某个分片上主键冲突或其他SQL错误,导致无法执行成功)分别加, 以说明

2.1 正常的跨分片事务分析

执行情况:

         mysql>set autocommit=0         mysql>update order040302 set SN=concat(SN,'-mycat');         QueryOK, 2 rows affected (0.01 sec)         Rowsmatched: 1  Changed: 1  Warnings: 0         mysql>commit;

mycat.log日志显示:

         02/1800:01:24.351  DEBUG [$_NIOREACTOR-1-RW](ServerQueryHandler.java:56) -ServerConnection [id=4, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]updateorder040302 set SN=concat(SN,'-mycat')        02/1800:01:24.356  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:113) -ServerConnection [id=4, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]updateorder040302 set SN=concat(SN,'-mycat'), route={            1 -> dn21{update order040302 setSN=concat(SN,'-mycat')}            2 -> dn22{update order040302 setSN=concat(SN,'-mycat')}         }rrs         02/1800:01:24.356  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:82) -execute mutinode query update order040302 setSN=concat(SN,'-mycat')         02/1800:01:24.357  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=7, lastTime=1455724884356, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=218, charset=latin1,txIsolation=3, autocommit=true, attachment=dn21{update order040302 setSN=concat(SN,'-mycat')},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@23eca0d1,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@71a27302,writeQueue=0, modifiedSQLExecuted=true]         02/1800:01:24.358  DEBUG [$_NIOREACTOR-2-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=30, lastTime=1455724884356, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=200, charset=latin1,txIsolation=3, autocommit=true, attachment=dn22{update order040302 setSN=concat(SN,'-mycat')},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@23eca0d1,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/1800:01:24.359  DEBUG [$_NIOREACTOR-2-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=30,lastTime=1455724884356, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=200, charset=latin1, txIsolation=3,autocommit=true, attachment=dn22{update order040302 setSN=concat(SN,'-mycat')},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@23eca0d1,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/1800:01:24.359  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=7, lastTime=1455724884356, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=218, charset=latin1,txIsolation=3, autocommit=true, attachment=dn21{update order040302 setSN=concat(SN,'-mycat')}, respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@23eca0d1,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/1800:01:24.359  DEBUG [$_NIOREACTOR-3-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=7,lastTime=1455724884356, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=218, charset=latin1, txIsolation=3,autocommit=true, attachment=dn21{update order040302 setSN=concat(SN,'-mycat')}, respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@23eca0d1,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/1800:01:24.359  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=7,lastTime=1455724884356, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=218, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]

分析结果:update语句是修改所有的节点上的数据,02/18 00:01:24.356处NonBlockingSession启动了分布式事务,下面就分别在02/18 00:01:24.359有2处 NonBlockingSession.java:229在dn21、dn22上面执行了2遍,大家看到在2个节点dn21和dn22都执行完毕后,才有(PhysicalDatasource.java:403)-release channel MySQLConnection开始关闭释放连接,也就是说等所有节点都执行完毕后才结束整个事务。


2.2 非正常的sql事务执行,有一处报错的情况下(失败经过)

     准备数据,需要一个节点成功,一个节点失败,所以准备拿SN字段的长度来做实验,一个超过报错,一个没有超过不报错

2.2.1 查看表结构:

 mysql>show create table order040302;+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+         |Table       | Create Table                                                                                                                                                                                                                                                 |+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+         |order040302 | CREATE TABLE `order040302` (           `ID` int(11) NOT NULL AUTO_INCREMENT,           `CODE` varchar(64) DEFAULT NULL,           `SN` varchar(64) DEFAULT NULL,           `CREATE_TIME` datetime DEFAULT NULL,           PRIMARY KEY (`ID`)         )ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 |+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+         1row in set (0.00 sec)  mysql>

修改数据,设置成如此,一会就可以update一个节点失败一个节点成功了,在ID=1的节点上因为长度超过64报错,而在ID=2的节点上面则长度小于64而正常执行:

mysql> update order040302 set SN =concat('',SN,'___',SN) where ID=1;         QueryOK, 1 row affected (0.01 sec)         Rowsmatched: 1  Changed: 1  Warnings: 0 mysql>select length(t1.SN),t1.* from order040302 t1;         +---------------+----+------------+-------------------------------------------------------+---------------------+         |length(t1.SN) | ID | CODE       | SN                                                   | CREATE_TIME         |         +---------------+----+------------+-------------------------------------------------------+---------------------+         |            53 |  1 | 0-10000020 |beijing_03-10000020-mycat___beijing_03-10000020-mycat | 2016-02-13 00:40:27 |         |            26 |  2 | 1-10000020 |shanghai_10-10000020-mycat                            | 2016-02-1300:40:18 |         +---------------+----+------------+-------------------------------------------------------+---------------------+         2rows in set (0.00 sec)mysql>   update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN) ;

2.2.2 mycat.log日志如下:

         02/2205:44:39.666  DEBUG [$_NIOREACTOR-0-RW](ServerQueryHandler.java:56) -ServerConnection [id=1, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]updateorder040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN)        02/2205:44:39.821  DEBUG [$_NIOREACTOR-0-RW](NonBlockingSession.java:113) -ServerConnection [id=1, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]updateorder040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN), route={            1 -> dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}            2 -> dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}         }rrs         02/2205:44:39.827  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:82) -execute mutinode query update order040302 setSN = concat('fenpianyigechenggong_yigeshibai_',SN)         02/2205:44:39.830  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=7, lastTime=1456091079827, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=245, charset=latin1,txIsolation=3, autocommit=true, attachment=dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@1c70f0b1,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@64b49aaa,writeQueue=0, modifiedSQLExecuted=true]         02/2205:44:39.831  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=12, lastTime=1456091079827, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=222, charset=latin1,txIsolation=3, autocommit=true, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}, respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@1c70f0b1,host=110.254.11.111, port=3327,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@306b3db1,writeQueue=0, modifiedSQLExecuted=true]         02/2205:44:39.831  DEBUG [$_NIOREACTOR-3-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=7,lastTime=1456091079827, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=245, charset=latin1, txIsolation=3,autocommit=true, attachment=dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@1c70f0b1,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@64b49aaa,writeQueue=0, modifiedSQLExecuted=true]         02/2205:44:39.832  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=7,lastTime=1456091079827, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=245, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/2205:44:39.832  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=12, lastTime=1456091079827, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=222, charset=latin1,txIsolation=3, autocommit=true, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@1c70f0b1,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2205:44:39.832   WARN [$_NIOREACTOR-3-RW](MultiNodeHandler.java:127) -error response from MySQLConnection [id=7,lastTime=1456091079827, user=root, schema=db3, old shema=db3, borrowed=false,fromSlaveDB=false, threadId=245, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] err Datatoo long for column 'SN' at row 1 code:1406         02/2205:44:39.833  DEBUG [$_NIOREACTOR-0-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=12,lastTime=1456091079827, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=222, charset=latin1, txIsolation=3,autocommit=true, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@1c70f0b1,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]        02/2205:44:39.834  DEBUG [$_NIOREACTOR-0-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=12,lastTime=1456091079827, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=222, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111, port=3327,statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/2205:44:39.835  DEBUG [$_NIOREACTOR-0-RW](MultiNodeHandler.java:194) -error all end ,clear session resource

从日志记录里面可以看出:[NIOREACTOR?3?RW]dn21节点失败,报错errDatatoolongforcolumn′SN′atrow1code:1406,[_NIOREACTOR-0-RW]节点dn22成功了,所以最后提示-error all end ,clear sessionresource,整个事务退出,清空当前会话资源,结论就是一个节点dn21失败,单节点回退,但是成功的节点dn22不会回退,这是怎么回事呢?查看执行后的数据结果如下:

         mysql>select length(t1.SN),t1.* from order040302 t1;         +---------------+----+------------+------------------------------------------------------------+---------------------+         |length(t1.SN) | ID | CODE       | SN                                                        | CREATE_TIME         |         +---------------+----+------------+------------------------------------------------------------+---------------------+         |            53 |  1 | 0-10000020 |beijing_03-10000020-mycat___beijing_03-10000020-mycat      | 2016-02-13 00:40:27 |         |            58 |  2 | 1-10000020 |fenpianyigechenggong_yigeshibai_shanghai_10-10000020-mycat | 2016-02-1300:40:18 |         +---------------+----+------------+------------------------------------------------------------+---------------------+         2rows in set (0.06 sec)  mysql>  
可见,我这个不是事务,事务会所有一起回退的。mycat窗口中如何开启事务?

2.3 如何mysql窗口那样,在mycat窗口开启事务

2.3.1 开启事务,手动提交

     mysql>set autocommit=0;     QueryOK, 0 rows affected (0.00 sec)     mysql>update order040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN) ;     ERROR1105 (HY000): Data too long for column 'SN' at row 1     mysql>commit;     ERROR1003 (HY000): Transaction error, need to rollback.     mysql>     mysql>select length(t1.SN),t1.* from order040302 t1;     ERROR1003 (HY000): Transaction error, need to rollback.Data too long for column 'SN'at row 1     mysql>     mysql>rollback;     QueryOK, 0 rows affected (0.01 sec)     mysql>     mysql>select length(t1.SN),t1.* from order040302 t1;     +---------------+----+------------+-------------------------------------------------------+---------------------+     |length(t1.SN) | ID | CODE       | SN                                                   | CREATE_TIME         |     +---------------+----+------------+-------------------------------------------------------+---------------------+     |            53 |  1 | 0-10000020 |beijing_03-10000020-mycat___beijing_03-10000020-mycat | 2016-02-13 00:40:27 |     |            26 |  2 | 1-10000020 |shanghai_10-10000020-mycat                            | 2016-02-1300:40:18 |     +---------------+----+------------+-------------------------------------------------------+---------------------+     2rows in set (0.09 sec)     mysql>

2.3.2 后台mycat.log日志如下,run失败信息如下:

         02/2217:54:25.035  DEBUG [$_NIOREACTOR-1-RW](ServerQueryHandler.java:56) -ServerConnection [id=2, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=false, schema=TESTDB]updateorder040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN)        02/2217:54:25.187  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:113) -ServerConnection [id=2, schema=TESTDB, host=127.0.0.1,user=test,txIsolation=3, autocommit=false, schema=TESTDB]update order040302 setSN = concat('fenpianyigechenggong_yigeshibai_',SN), route={            1 -> dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}            2 -> dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}         }rrs         02/2217:54:25.193  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:82) -execute mutinode query update order040302 setSN = concat('fenpianyigechenggong_yigeshibai_',SN)         02/2217:54:25.195  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=7, lastTime=1456134865193, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=278, charset=latin1,txIsolation=0, autocommit=true, attachment=dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true]         02/2217:54:25.196  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=17, lastTime=1456134865193, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=259, charset=latin1,txIsolation=0, autocommit=true, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3327,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@46e9d255,writeQueue=0, modifiedSQLExecuted=true]         02/2217:54:25.196  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=7, lastTime=1456134865193, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=278, charset=latin1,txIsolation=3, autocommit=false, attachment=dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true]         02/2217:54:25.196  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=17, lastTime=1456134865193, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=259, charset=latin1,txIsolation=3, autocommit=false, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)}, respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3327,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@46e9d255,writeQueue=0, modifiedSQLExecuted=true]         02/2217:54:25.197   WARN [$_NIOREACTOR-3-RW](MultiNodeHandler.java:127) -error response from MySQLConnection [id=7,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=278, charset=latin1, txIsolation=3,autocommit=false, attachment=dn21{update order040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true] err Data too long for column 'SN' atrow 1 code:1406         02/2217:54:25.197  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=17, lastTime=1456134865193, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=259, charset=latin1,txIsolation=3, autocommit=false, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2217:54:25.199  DEBUG [$_NIOREACTOR-1-RW](MultiNodeHandler.java:194) -error all end ,clear session resource      

2.3.3后台mycat.log日志,rollback操作日志如下:

         02/2217:57:17.432  DEBUG [$_NIOREACTOR-1-RW](ServerQueryHandler.java:56) -ServerConnection [id=2, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=false,schema=TESTDB]rollback         02/2217:57:17.434  DEBUG [$_NIOREACTOR-1-RW] (RollbackNodeHandler.java:71)-rollback job run for MySQLConnection [id=7, lastTime=1456134865193, user=root,schema=db3, old shema=db3, borrowed=true, fromSlaveDB=false, threadId=278,charset=latin1, txIsolation=3, autocommit=false, attachment=dn21{updateorder040302 set SN = concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true]         02/2217:57:17.435  DEBUG [$_NIOREACTOR-1-RW](RollbackNodeHandler.java:71) -rollback job run for MySQLConnection [id=17,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=259, charset=latin1, txIsolation=3,autocommit=false, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@243cc381,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2217:57:17.436  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:361) -clear session resourcesorg.opencloudb.server.NonBlockingSession@4483dae0         02/2217:57:17.436  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=7,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=278, charset=latin1, txIsolation=3,autocommit=false, attachment=dn21{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.RollbackNodeHandler@2c96cb44,host=110.254.11.111, port=3317, statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true]         02/2217:57:17.438  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=17,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=259, charset=latin1, txIsolation=3,autocommit=false, attachment=dn22{update order040302 set SN =concat('fenpianyigechenggong_yigeshibai_',SN)},respHandler=org.opencloudb.mysql.nio.handler.RollbackNodeHandler@2c96cb44,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2217:57:17.438  DEBUG [$_NIOREACTOR-3-RW](RollbackReleaseHandler.java:58) -autocomit is false,but no commit or rollback,so mycat rollbacked backend conn MySQLConnection [id=7,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=278, charset=latin1, txIsolation=3,autocommit=false, attachment=null,respHandler=org.opencloudb.mysql.nio.handler.RollbackReleaseHandler@56683a8d,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@4ff5e91e,writeQueue=0, modifiedSQLExecuted=true]         02/2217:57:17.439  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=7,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=278, charset=latin1, txIsolation=3,autocommit=false, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/2217:57:17.439  DEBUG [$_NIOREACTOR-1-RW](RollbackReleaseHandler.java:58) -autocomit is false,but no commit or rollback,so mycat rollbacked backend conn MySQLConnection [id=17,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=259, charset=latin1, txIsolation=3,autocommit=false, attachment=null,respHandler=org.opencloudb.mysql.nio.handler.RollbackReleaseHandler@429eb61a,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]        02/2217:57:17.440  DEBUG [$_NIOREACTOR-1-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=17,lastTime=1456134865193, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=259, charset=latin1, txIsolation=3,autocommit=false, attachment=null, respHandler=null, host=110.254.11.111,port=3327, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]

看到在执行update的时候,有报错信息:在dn21节点上面err Data too long forcolumn ‘SN’ at row 1 code:1406,所以按照理论上任何节点发生错误了,就面临rollback的错误信息,任何任何都会提示报错信息,只能执行rollback来恢复。PS:这里目前的mycat版本没有办法做到在update失败后自动rollback,需要手动rollback操作。


3创建一个在多个分片上存在的存储过程,存储过程可以是统计某个表的记录个数并返回,然后用Mycat注解方式完成调用

3.1准备好的简单的存储过程

         DELIMITER$$         CREATE                   PROCEDUREdb3.pro_select()                   BEGIN                            SELECTCOUNT(1) FROM order040302;                   END$$         DELIMITER;

3.2在各mysql节点上执行创建存储过程

dn21节点上的mysql窗口上:

         mysql>DELIMITER $$         mysql>CREATE                   ->     PROCEDURE `db3`.`pro_select`()                   ->     BEGIN                   ->SELECT COUNT(1) FROM order040302;                   ->     END$$         QueryOK, 0 rows affected (0.01 sec)         mysql>DELIMITER ;         mysql>

dn22节点上的mysql窗口上:

         mysql>DELIMITER $$         mysql>CREATE                   ->     PROCEDURE `db3`.`pro_select`()                   ->     BEGIN                   ->SELECT COUNT(1) FROM order040302;                   ->     END$$         QueryOK, 0 rows affected (0.01 sec)         mysql>DELIMITER ;         mysql>

检查存储过程:

         mysql>select * from information_schema.ROUTINES\G         ***************************1. row ***************************                               SPECIFIC_NAME: pro_select                             ROUTINE_CATALOG: def                              ROUTINE_SCHEMA: db3                                     ROUTINE_NAME:pro_select                                     ROUTINE_TYPE:PROCEDURE                                        DATA_TYPE:         CHARACTER_MAXIMUM_LENGTH:NULL           CHARACTER_OCTET_LENGTH: NULL                      NUMERIC_PRECISION: NULL                               NUMERIC_SCALE: NULL                     DATETIME_PRECISION: NULL                     CHARACTER_SET_NAME: NULL                              COLLATION_NAME: NULL                              DTD_IDENTIFIER: NULL                                     ROUTINE_BODY:SQL                     ROUTINE_DEFINITION: BEGIN         SELECTCOUNT(1) FROM order040302;                   END                               EXTERNAL_NAME: NULL                      EXTERNAL_LANGUAGE: NULL                             PARAMETER_STYLE: SQL                            IS_DETERMINISTIC: NO                             SQL_DATA_ACCESS: ConTAINS SQL                                               SQL_PATH:NULL                               SECURITY_TYPE: DEFINER                                                CREATED: 2016-02-22 19:17:12                                     LAST_ALTERED:2016-02-22 19:17:12                                               SQL_MODE:STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION                             ROUTINE_COMMENT:                                                DEFINER: root@localhost                   CHARACTER_SET_CLIENT:latin1                   COLLATION_CONNECTION:latin1_swedish_ci                     DATAbase_COLLATION: utf8mb4_general_ci         1row in set (0.00 sec)         mysql>

然后在mycat中执行:

         mysql> call pro_select();         +----------+         |COUNT(1) |         +----------+         |        1 |         |        1 |         +----------+         2rows in set (0.01 sec)         QueryOK, 0 rows affected (0.01 sec)         mysql>

问题,为啥是2行记录,不知道可以不可以并成一行记录呢?
普通sql到了最后会有如下:

02/23 00:07:21.478  DEBUG [BusinessExecutor0] (DataMergeService.java:296) -prepare mpp merge result for select count(*) from order04030202/23 00:07:21.479  DEBUG [BusinessExecutor0] (MultiNodeQueryHandler.java:324) -last packet id:5

的聚合操作,有了这个merge result操作后,就会把2条记录变成一条记录,但是mycat注解后的执行sql显示注解后,没有这一个merge result的操作,所以是2条记录。哇塞,我好伟大,发现了其中的区别,但是那么新问题来了,怎么完善注解后生成的2条记录变成为1条记录额?


3.3看后台mycat.log日志:

看到日志中42.293记录,走的route路由进入dn21和dn22节点上面,最终执行的是注解的-execute mutinode query select * from order040302,如下所示:

02/22 20:19:42.292  DEBUG [$_NIOREACTOR-1-RW](ServerQueryHandler.java:56) -ServerConnection [id=10, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true,schema=TESTDB] call pro_select()         02/22 20:19:42.293  DEBUG [$_NIOREACTOR-1-RW](NonBlockingSession.java:113) -ServerConnection [id=10, schema=TESTDB,host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=TESTDB]select* from order040302, route={            1 -> dn21{call pro_select()}            2 -> dn22{call pro_select()}         } rrs         02/22 20:19:42.293  DEBUG [$_NIOREACTOR-1-RW](MultiNodeQueryHandler.java:82) -execute mutinode query select * fromorder040302         02/2220:19:42.295  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:falsefrom MySQLConnection [id=4, lastTime=1456143582284, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=280, charset=latin1,txIsolation=3, autocommit=true, attachment=dn21{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@939bc30,writeQueue=0, modifiedSQLExecuted=true]         02/2220:19:42.295  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:241) -on row end reseponse MySQLConnection [id=11,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=254, charset=latin1, txIsolation=3, autocommit=true,attachment=dn22{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2220:19:42.295  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:241) -on row end reseponse MySQLConnection [id=4,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=280, charset=latin1, txIsolation=3,autocommit=true, attachment=dn21{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3317,statusSync=org.opencloudb.mysql.nio.MySQLConnection$StatusSync@939bc30,writeQueue=0, modifiedSQLExecuted=true]         02/2220:19:42.296  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:280) -last packet id:6         02/2220:19:42.295  DEBUG [$_NIOREACTOR-3-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=11, lastTime=1456143582284, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=254, charset=latin1,txIsolation=3, autocommit=true, attachment=dn22{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2220:19:42.296  DEBUG [$_NIOREACTOR-0-RW](MultiNodeQueryHandler.java:171) -received ok response ,executeResponse:truefrom MySQLConnection [id=4, lastTime=1456143582284, user=root, schema=db3, oldshema=db3, borrowed=true, fromSlaveDB=false, threadId=280, charset=latin1,txIsolation=3, autocommit=true, attachment=dn21{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2220:19:42.296  DEBUG [$_NIOREACTOR-3-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=11,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=254, charset=latin1, txIsolation=3,autocommit=true, attachment=dn22{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3327, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]         02/2220:19:42.296  DEBUG [$_NIOREACTOR-0-RW](NonBlockingSession.java:229) -release connection MySQLConnection [id=4,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=280, charset=latin1, txIsolation=3,autocommit=true, attachment=dn21{call pro_select()},respHandler=org.opencloudb.mysql.nio.handler.MultiNodeQueryHandler@ba5d1a4,host=110.254.11.111, port=3317, statusSync=null, writeQueue=0,modifiedSQLExecuted=true]        02/2220:19:42.296  DEBUG [$_NIOREACTOR-3-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=11,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveDB=false, threadId=254, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111, port=3327,statusSync=null, writeQueue=0, modifiedSQLExecuted=false]         02/2220:19:42.297  DEBUG [$_NIOREACTOR-0-RW](PhysicalDatasource.java:403) -release channel MySQLConnection [id=4,lastTime=1456143582284, user=root, schema=db3, old shema=db3, borrowed=true,fromSlaveD**重点内容**B=false, threadId=280, charset=latin1, txIsolation=3,autocommit=true, attachment=null, respHandler=null, host=110.254.11.111,port=3317, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]