Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data truncation: Data too long for column 'row_key' #1158

Closed
1 task done
lixuzhou opened this issue Jun 4, 2019 · 0 comments · Fixed by #1159
Closed
1 task done

Data truncation: Data too long for column 'row_key' #1158

lixuzhou opened this issue Jun 4, 2019 · 0 comments · Fixed by #1159

Comments

@lixuzhou
Copy link
Contributor

lixuzhou commented Jun 4, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

the server throws a MysqlDataTruncation exception when acquiring lock.

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

2019-06-04 13:13:54.870 ERROR[ServerHandlerThread_83_500]io.seata.core.lock.AbstractLocker.acquireLock:66 -AcquireLock error, locks:[xid=192.168.1.63:8092:2013343831;transactionId=2013343831;branchId=2013343895;resourceId=jdbc:mysql://192.168.1.64:3306/anttalk_mall_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&&allowMultiQueries=true;tableName=t_order_merge;pk=23392559079350272;rowKey=null;feature=null;]
io.seata.common.exception.StoreException: Data truncation: Data too long for column 'row_key' at row 1
	at io.seata.core.store.db.LockStoreDataBaseDAO.doAcquireLock(LockStoreDataBaseDAO.java:263)
	at io.seata.core.store.db.LockStoreDataBaseDAO.acquireLock(LockStoreDataBaseDAO.java:139)
	at io.seata.server.lock.db.DataBaseLocker.acquireLock(DataBaseLocker.java:64)
	at io.seata.server.lock.DefaultLockManager.acquireLock(DefaultLockManager.java:50)
	at io.seata.server.session.BranchSession.lock(BranchSession.java:272)
	at io.seata.server.coordinator.DefaultCore.lambda$branchRegister$0(DefaultCore.java:74)
	at io.seata.server.session.GlobalSession.lockAndExcute(GlobalSession.java:594)
	at io.seata.server.coordinator.DefaultCore.branchRegister(DefaultCore.java:62)
	at io.seata.server.coordinator.DefaultCoordinator.doBranchRegister(DefaultCoordinator.java:169)
	at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:148)
	at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:144)
	at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:113)
	at io.seata.server.AbstractTCInboundHandler.handle(AbstractTCInboundHandler.java:144)
	at io.seata.core.protocol.transaction.BranchRegisterRequest.handle(BranchRegisterRequest.java:239)
	at io.seata.server.coordinator.DefaultCoordinator.onRequest(DefaultCoordinator.java:418)
	at io.seata.core.rpc.DefaultServerMessageListenerImpl.onTrxMessage(DefaultServerMessageListenerImpl.java:85)
	at io.seata.core.rpc.netty.RpcServer.dispatch(RpcServer.java:253)
	at io.seata.core.rpc.netty.AbstractRpcRemoting$3.run(AbstractRpcRemoting.java:356)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'row_key' at row 1
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:960)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1116)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1066)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1396)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1051)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at io.seata.core.store.db.LockStoreDataBaseDAO.doAcquireLock(LockStoreDataBaseDAO.java:261)
	... 21 common frames omitted

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. lock.mode = "db"
  2. use MySQL 8.0 with db.url="jdbc:mysql://192.168.1.64:3306/mall_seata?useUnicode=true&characterEncoding=utf-8&useSSL=false&&allowMultiQueries=true&allowPublicKeyRetrieval=true"
  3. execute a global transaction

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version : 1.8
  • OS : CentOS Linux release 7.4.1708 (Core)
  • Others: MySQL 8.0.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant