Closed peilinqian closed 3 months ago
Can you provide the sql which cause this exception?
build success,run benchmark error;
20:21:02,182 [main] INFO jTPCC : Term-00,
20:21:02,182 [main] INFO jTPCC : Term-00, warehouses=5
20:21:02,182 [main] INFO jTPCC : Term-00, terminals=5
20:21:02,183 [main] INFO jTPCC : Term-00, runMins=1
20:21:02,184 [main] INFO jTPCC : Term-00, limitTxnsPerMin=0
20:21:02,184 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=false
20:21:02,184 [main] INFO jTPCC : Term-00,
20:21:02,184 [main] INFO jTPCC : Term-00, newOrderWeight=45
20:21:02,184 [main] INFO jTPCC : Term-00, paymentWeight=43
20:21:02,184 [main] INFO jTPCC : Term-00, orderStatusWeight=4
20:21:02,184 [main] INFO jTPCC : Term-00, deliveryWeight=4
20:21:02,184 [main] INFO jTPCC : Term-00, stockLevelWeight=4
20:21:02,184 [main] INFO jTPCC : Term-00,
20:21:02,184 [main] INFO jTPCC : Term-00, resultDirectory=null
20:21:02,184 [main] INFO jTPCC : Term-00, osCollectorScript=null
20:21:02,184 [main] INFO jTPCC : Term-00,
20:21:02,485 [main] INFO jTPCC : Term-00, C value for C_LAST during load: 251
20:21:02,486 [main] INFO jTPCC : Term-00, C value for C_LAST this run: 173
20:21:02,486 [main] INFO jTPCC : Term-00, 20:21:03,271 [Thread-3] ERROR jTPCCTData : Unexpected SQLException in PAYMENT5MB / 481MB
20:21:03,271 [Thread-3] ERROR jTPCCTData : [7.212.123.28:52156/7.212.123.28:11000] ERROR: duplicate key value violates unique constraint "bmsql_history_pkey"
Detail: Key (hist_id)=(1) already exists.
org.postgresql.util.PSQLException: [7.212.123.28:52156/7.212.123.28:11000] ERROR: duplicate key value violates unique constraint "bmsql_history_pkey"
Detail: Key (hist_id)=(1) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2846)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2575)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:336)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:464)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:378)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:142)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:117)
at jTPCCTData.executePayment(jTPCCTData.java:929)
at jTPCCTData.execute(jTPCCTData.java:99)
at jTPCCTerminal.executeTransactions(jTPCCTerminal.java:160)
at jTPCCTerminal.run(jTPCCTerminal.java:88)
at java.lang.Thread.run(Thread.java:748)
20:21:03,278 [Thread-2] ERROR jTPCCTData : Unexpected SQLException in PAYMENT
[INFO ] 2022-12-28 20:21:03.256 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: UPDATE bmsql_customer SET c_balance = c_balance - ?, c_ytd_payment = c_ytd_payment + ?, c_payment_cnt = c_payment_cnt + 1 WHERE c_w_id = ? AND c_d_id = ? AND c_id = ?
[INFO ] 2022-12-28 20:21:03.256 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: UPDATE bmsql_customer SET c_balance = c_balance - ?, c_ytd_payment = c_ytd_payment + ?, c_payment_cnt = c_payment_cnt + 1 WHERE c_w_id = ? AND c_d_id = ? AND c_id = ? ::: [1012.91, 1012.91, 3, 6, 2986]
[INFO ] 2022-12-28 20:21:03.259 [HikariPool-4 connection adder] o.o.core.v3.ConnectionFactoryImpl - [7.212.123.28:49304/10.29.180.204:16000] Connection is established. ID: 887d8d32-eb21-46cc-bdf8-29291c82b780
[INFO ] 2022-12-28 20:21:03.260 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: INSERT INTO bmsql_history ( h_c_id, h_c_d_id, h_c_w_id, h_d_id, h_w_id, h_date, h_amount, h_data) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
[INFO ] 2022-12-28 20:21:03.260 [Connection-16-ThreadExecutor] ShardingSphere-SQL - Logic SQL: SELECT s_quantity, s_data, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10 FROM bmsql_stock WHERE s_w_id = ? AND s_i_id = ? FOR UPDATE
[INFO ] 2022-12-28 20:21:03.260 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: INSERT INTO bmsql_history ( h_c_id, h_c_d_id, h_c_w_id, h_d_id, h_w_id, h_date, h_amount, h_data) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ::: [2986, 6, 3, 6, 3, 2022-12-28 20:21:03.058+08, 1012.91, TPZo0C VXlGrkx9]
[INFO ] 2022-12-28 20:21:03.260 [Connection-16-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT s_quantity, s_data, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10 FROM bmsql_stock WHERE s_w_id = ? AND s_i_id = ? FOR UPDATE ::: [5, 22934]
[INFO ] 2022-12-28 20:21:03.264 [Connection-16-ThreadExecutor] ShardingSphere-SQL - Logic SQL: SELECT i_price, i_name, i_data FROM bmsql_item WHERE i_id = ?
[INFO ] 2022-12-28 20:21:03.264 [Connection-16-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT i_price, i_name, i_data FROM bmsql_item WHERE i_id = ? ::: [30149]
[ERROR] 2022-12-28 20:21:03.265 [Connection-18-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
org.opengauss.util.PSQLException: [7.212.123.28:49294/10.29.180.204:16000] ERROR: duplicate key value violates unique constraint "bmsql_history_pkey"
Detail: Key (hist_id)=(1) already exists.
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.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:156)
at org.opengauss.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:145)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyPreparedStatementExecutorCallback.execute(ProxyPreparedStatementExecutorCallback.java:43)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:75)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:68)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:45)
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:90)
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:69)
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:135)
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.serialExecute(ExecutorEngine.java:121)
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:115)
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:67)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:75)
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:229)
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.doExecute(ProxySQLExecutor.java:186)
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:151)
at org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:131)
at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.JDBCPortal.bind(JDBCPortal.java:101)
at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:53)
at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.PostgreSQLAggregatedCommandExecutor.execute(PostgreSQLAggregatedCommandExecutor.java:41)
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:748)
Please try lasted version, the TPCC can be tested
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.2-SNAPSHOT Commit ID: dirty-753c0cee8ee6fd3db00536da55b64bc5198a3758 Commit Message: Optimize sqlFederationExecutor init logic when sqlFederationType modify dynamically (https://github.com/apache/shardingsphere/pull/22209) Branch: https://github.com/apache/shardingsphere/commit/753c0cee8ee6fd3db00536da55b64bc5198a3758 Build time: 2022-11-19T10:18:41+0800
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
Use TPCC to runDatabaseBuild ,execute success
Actual behavior
Use TPCC to runDatabaseBuild ,returning error
Reason analyze (If you can)
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
1、. runDatabaseDestroy.sh props.proxy
Example codes for reproduce this issue (such as a github link).