You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/07/30 10:03:32 UTC
[GitHub] [incubator-shardingsphere] bskllzh opened a new issue #2792:
Exception occur: java.lang.IndexOutOfBoundsException: readerIndex(11) +
length(1) exceeds writerIndex(11)
bskllzh opened a new issue #2792: Exception occur: java.lang.IndexOutOfBoundsException: readerIndex(11) + length(1) exceeds writerIndex(11)
URL: https://github.com/apache/incubator-shardingsphere/issues/2792
## Bug Report
**For English only**, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
Please answer these questions before submitting your issue. Thanks!
### Which version of ShardingSphere did you use?
4.0.0.0-RC1
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-Proxy
### Expected behavior
Read data correctly from the ByteBuf of sharding-proxy。
source code of sharding-proxy:
org.apache.shardingsphere.shardingproxy.transport.mysql.payload.MySQLPacketPayload.readInt1(MySQLPacketPayload.java:49)
MySQLPacketPayload.java:
public int readInt1() {
return byteBuf.readByte() & 0xff;
}
### Actual behavior
[ERROR] 16:43:08.056 [ShardingSphere-Command-6] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
java.lang.IndexOutOfBoundsException: readerIndex(11) + length(1) exceeds writerIndex(11): PooledSlicedByteBuf(ridx: 11, widx: 11, ca
p: 11/11, unwrapped: PooledUnsafeDirectByteBuf(ridx: 14, widx: 14, cap: 64))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1401)
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:707)
at org.apache.shardingsphere.shardingproxy.transport.mysql.payload.MySQLPacketPayload.readInt1(MySQLPacketPayload.java:49)
at org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.MySQLComStmtExecutePacket.<in
it>(MySQLComStmtExecutePacket.java:79)
at org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.MySQLCommandPacketFactory.newInstance(MySQLCommand
PacketFactory.java:66)
at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandPacket(MySQLCommandExe
cuteEngine.java:55)
at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandPacket(MySQLCommandExe
cuteEngine.java:46)
at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:84)
at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
This exception occur when i make a benchmark test of mysql master-slave that is configed read-write spliting with sysbench 1.0.17。
benchmark test script ( Sharding-Proxy node ):
sysbench /usr/local/share/sysbench/oltp_read_write.lua
--time=300
--mysql-host=XX.XX.XX.XX
--mysql-port=3307
--mysql-user=XX
--mysql-password=XX
--mysql-db=db01
--table-size=1000000
--tables=10
--threads=100
--report-interval=10 run
I have only configed config-master_slave.yaml file that used read-write spliting in mysql master-slave cluster。
config-master_slave.yaml
######################################################################################################
#
# If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
#
######################################################################################################
schemaName: db01
dataSources:
master_ds:
url: jdbc:mysql://XX.XX.XX.XX:3306/db01?serverTimezone=UTC&useSSL=false
username: xxxx
password: xxxx
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
slave_ds_0:
url: jdbc:mysql://XX.XX.XX.XX:3306/db01?serverTimezone=UTC&useSSL=false
username: xxxx
password: xxxx
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
slave_ds_1:
url: jdbc:mysql://XX.XX.XX.XX:3306/db01?serverTimezone=UTC&useSSL=false
username: xxxx
password: xxxx
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
masterSlaveRule:
name: ms_ds
masterDataSourceName: master_ds
slaveDataSourceNames:
- slave_ds_0
- slave_ds_1
### Example codes for reproduce this issue (such as a github link).
This exception occur when i make a benchmark test of mysql master-slave that is configed read-write spliting with sysbench 1.0.17。
benchmark test script ( Sharding-Proxy node ):
sysbench /usr/local/share/sysbench/oltp_read_write.lua
--time=300
--mysql-host=XX.XX.XX.XX
--mysql-port=3307
--mysql-user=XX
--mysql-password=XX
--mysql-db=db01
--table-size=1000000
--tables=10
--threads=100
--report-interval=10 run
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services