peilinqian opened a new issue, #21237: URL: https://github.com/apache/shardingsphere/issues/21237
## 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/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 anymore 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? we find java version: java8, full_version=1.8.0_342, full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java ShardingSphere-5.2.1-SNAPSHOT Commit ID: dirty-4114e7ee4cbe5923c2b403a3e86d1f23355cadf3 Commit Message: Fix parse exception when execute insert statement with negative value (#21197) Branch: 4114e7ee4cbe5923c2b403a3e86d1f23355cadf3 Build time: 2022-09-27T16:37:07+0800 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-Proxy ### Expected behavior In READWRITE_SPLITTING mode,transaction commit is normal ### Actual behavior ``` test_db=> begin; BEGIN test_db=> insert into t_rw values(6,6,60,'test6'); INSERT 0 1 test_db=> select * from t_rw; id | c_id | a | b ----+------+----+------- 1 | 1 | 10 | test1 1 | 2 | 10 | test1 2 | 2 | 20 | test2 3 | 3 | 10 | test3 4 | 4 | 40 | test4 5 | 5 | 50 | test5 6 | 6 | 60 | test6 6 | 6 | 60 | test6 (8 rows) test_db=> select * from t_rw; id | c_id | a | b ----+------+----+------- 1 | 1 | 10 | test1 1 | 2 | 10 | test1 2 | 2 | 20 | test2 3 | 3 | 10 | test3 4 | 4 | 40 | test4 5 | 5 | 50 | test5 6 | 6 | 60 | test6 6 | 6 | 60 | test6 (8 rows) test_db=> end; COMMIT ``` READWRITE_SPLITTING DB ``` split_db=> begin; BEGIN split_db=> insert into t_rw values(6,6,60,'test6'); INSERT 0 1 split_db=> select * from t_rw; id | c_id | a | b ----+------+----+------- 1 | 1 | 10 | test1 1 | 2 | 10 | test1 2 | 2 | 20 | test2 3 | 3 | 10 | test3 4 | 4 | 40 | test4 5 | 5 | 50 | test5 (6 rows) split_db=> select * from t_rw; id | c_id | a | b ----+------+----+------- 1 | 1 | 10 | test1 1 | 2 | 10 | test1 2 | 2 | 20 | test2 3 | 3 | 10 | test3 4 | 4 | 40 | test4 5 | 5 | 50 | test5 (6 rows) split_db=> end; ERROR: javax.transaction.HeuristicMixedException ``` ``` [INFO ] 2022-09-28 16:19:48.871 [Connection-4-ThreadExecutor] ShardingSphere-SQL - Actual SQL: read0_0 ::: select * from t_rw; [ERROR] 2022-09-28 16:19:48.965 [Connection-4-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: javax.transaction.HeuristicMixedException: null at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1303) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:128) at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.commit(XAShardingSphereTransactionManager.java:108) at org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager.commit(JDBCBackendTransactionManager.java:79) at org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager.commit(JDBCBackendTransactionManager.java:37) at org.apache.shardingsphere.proxy.backend.handler.transaction.TransactionBackendHandler.execute(TransactionBackendHandler.java:125) at org.apache.shardingsphere.proxy.frontend.opengauss.command.query.simple.OpenGaussComQueryExecutor.execute(OpenGaussComQueryExecutor.java:76) at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:111) at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78) 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:750) Suppressed: org.opengauss.xa.PGXAException: Error preparing transaction. prepare xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000001:96c7:63340291:63, node_name=1, branch_uid=0:ffff7f000001:96c7:63340291:68, subordinatenodename=null, eis_name=0 > at org.opengauss.xa.PGXAConnection.prepare(PGXAConnection.java:360) at org.apache.shardingsphere.transaction.xa.spi.SingleXAResource.prepare(SingleXAResource.java:66) at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelPrepare(XAResourceRecord.java:214) at com.arjuna.ats.arjuna.coordinator.BasicAction.doPrepare(BasicAction.java:2678) at com.arjuna.ats.arjuna.coordinator.BasicAction.doPrepare(BasicAction.java:2628) at com.arjuna.ats.arjuna.coordinator.BasicAction.prepare(BasicAction.java:2162) at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1508) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1295) ... 11 common frames omitted Caused by: org.opengauss.util.PSQLException: [90.90.44.175:40024/90.90.44.173:14000] ERROR: cannot execute PREPARE TRANSACTION during recovery at org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901) at org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630) at org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362) at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562) at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539) at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339) at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302) at org.opengauss.jdbc.PgStatement.executeUpdate(PgStatement.java:275) at org.opengauss.xa.PGXAConnection.prepare(PGXAConnection.java:352) ... 20 common frames omitted Suppressed: org.opengauss.xa.PGXAException: Error preparing transaction. prepare xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000001:96c7:63340291:63, node_name=1, branch_uid=0:ffff7f000001:96c7:63340291:68, subordinatenodename=null, eis_name=0 > at org.opengauss.xa.PGXAConnection.prepare(PGXAConnection.java:360) at org.apache.shardingsphere.transaction.xa.spi.SingleXAResource.prepare(SingleXAResource.java:66) at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelPrepare(XAResourceRecord.java:214) at com.arjuna.ats.arjuna.coordinator.BasicAction.doPrepare(BasicAction.java:2678) at com.arjuna.ats.arjuna.coordinator.BasicAction.doPrepare(BasicAction.java:2628) at com.arjuna.ats.arjuna.coordinator.BasicAction.prepare(BasicAction.java:2162) at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1508) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1295) ... 11 common frames omitted Caused by: org.opengauss.util.PSQLException: [90.90.44.175:40024/90.90.44.173:14000] ERROR: cannot execute PREPARE TRANSACTION during recovery at org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901) at org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630) at org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362) at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562) at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539) at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339) at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302) at org.opengauss.jdbc.PgStatement.executeUpdate(PgStatement.java:275) at org.opengauss.xa.PGXAConnection.prepare(PGXAConnection.java:352) ... 20 common frames omitted Suppressed: org.opengauss.xa.PGXAException: Error rolling back prepared transaction. rollback xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000001:96c7:63340291:63, node_name=1, branch_uid=0:ffff7f000001:96c7:63340291:68, subordinatenodename=null, eis_name=0 >, preparedXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000001:96c7:63340291:63, node_name=1, branch_uid=0:ffff7f000001:96c7:63340291:68, subordinatenodename=null, eis_name=0 >, currentXid={2} at org.opengauss.xa.PGXAConnection.rollback(PGXAConnection.java:464) at org.apache.shardingsphere.transaction.xa.spi.SingleXAResource.rollback(SingleXAResource.java:76) at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:362) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3037) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3016) at com.arjuna.ats.arjuna.coordinator.BasicAction.phase2Abort(BasicAction.java:1986) at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1524) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1295) ... 11 common frames omitted Caused by: org.opengauss.util.PSQLException: [90.90.44.175:40024/90.90.44.173:14000] ERROR: cannot execute ROLLBACK PREPARED during recovery at org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901) at org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630) at org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362) at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562) at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539) at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339) at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325) at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302) at org.opengauss.jdbc.PgStatement.executeUpdate(PgStatement.java:275) at org.opengauss.xa.PGXAConnection.rollback(PGXAConnection.java:457) ... 20 common frames omitted ``` ### Reason analyze (If you can) ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. ### Example codes for reproduce this issue (such as a github link). -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
