waterguo / benchmarksql

BenchmarkSQL for MySQL, PostgreSQL and Oracle
13 stars 13 forks source link

Why PostgresSQL cannot run ? #7

Open Otis4631 opened 4 years ago

Otis4631 commented 4 years ago

I followed the instruction in the README.md and get the Error blow.

2020-10-25 19:10:01,326 ERROR - payUpdateWhse() not found! W_ID=9
2020-10-25 19:10:01,326 ERROR - payGetWhse() not found! W_ID=9
2020-10-25 19:10:01,326 ERROR - Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1292
Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1292
2020-10-25 19:10:01,327 ERROR - org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2881)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1956)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2568)
        at jTPCCTerminal.paymentTransaction(jTPCCTerminal.java:1276)
        at jTPCCTerminal.executeTransaction(jTPCCTerminal.java:321)
        at jTPCCTerminal.executeTransactions(jTPCCTerminal.java:172)
        at jTPCCTerminal.run(jTPCCTerminal.java:122)
        at java.base/java.lang.Thread.run(Thread.java:832)

2020-10-25 19:10:01,327 ERROR - stmtGetCustWhse() not found! W_ID=9 C_D_ID=8 C_ID=687
2020-10-25 19:10:01,328 ERROR - --- Unexpected SQLException caught in NEW-ORDER Txn ---
2020-10-25 19:10:01,328 ERROR - ResultSet not positioned properly, perhaps you need to call next.
2020-10-25 19:10:01,328 ERROR - payUpdateWhse() not found! W_ID=9
2020-10-25 19:10:01,328 ERROR - payGetWhse() not found! W_ID=9
2020-10-25 19:10:01,328 ERROR - Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1294
Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1294
2020-10-25 19:10:01,328 ERROR - org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2881)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1956)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2568)
        at jTPCCTerminal.paymentTransaction(jTPCCTerminal.java:1276)
        at jTPCCTerminal.executeTransaction(jTPCCTerminal.java:321)
        at jTPCCTerminal.executeTransactions(jTPCCTerminal.java:172)
        at jTPCCTerminal.run(jTPCCTerminal.java:122)
        at java.base/java.lang.Thread.run(Thread.java:832)

2020-10-25 19:10:01,329 ERROR - stmtGetCustWhse() not found! W_ID=9 C_D_ID=3 C_ID=188
2020-10-25 19:10:01,329 ERROR - --- Unexpected SQLException caught in NEW-ORDER Txn ---
2020-10-25 19:10:01,329 ERROR - ResultSet not positioned properly, perhaps you need to call next.
2020-10-25 19:10:01,330 ERROR - payUpdateWhse() not found! W_ID=9
2020-10-25 19:10:01,330 ERROR - payGetWhse() not found! W_ID=9
2020-10-25 19:10:01,330 ERROR - Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1296
Term-01, TERMINAL=Term-01  TYPE=PAYMENT  COUNT=1296
2020-10-25 19:10:01,330 ERROR - org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2881)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1956)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2568)
        at jTPCCTerminal.paymentTransaction(jTPCCTerminal.java:1276)
        at jTPCCTerminal.executeTransaction(jTPCCTerminal.java:321)
        at jTPCCTerminal.executeTransactions(jTPCCTerminal.java:172)
        at jTPCCTerminal.run(jTPCCTerminal.java:122)
        at java.base/java.lang.Thread.run(Thread.java:832)

props.pg:

driver=org.postgresql.Driver
conn=jdbc:postgresql://localhost:5432/postgres
user=postgres
password=123456

warehouses=100
terminals=1
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=1
//Number of total transactions per minute
limitTxnsPerMin=0

//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4
waterguo commented 4 years ago

Let me check the code. I will get back to you. This code is from original BechmarkSQL project.

waterguo commented 4 years ago

I checked bechmarksql source code. The error is caused by the following lines:

              if (payGetWhse == null) {
                payGetWhse = conn.prepareStatement(
                  "SELECT w_street_1, w_street_2, w_city, w_state, w_zip, w_name" +
                  " FROM benchmarksql.warehouse WHERE w_id = ?");
              }

              payGetWhse.setInt(1, w_id);

              rs = payGetWhse.executeQuery();
              if (!rs.next()) {
                log.error("payGetWhse() not found! W_ID=" + w_id);
              }

My best guess is that your data is kinda corrupted. I suggest you empty your database and repopulate. If this happens again, attach the error log. It can provide me the details to look deeper.

shivam2093 commented 3 years ago

I got an error when I try to run ./runSQL.sh props.pg sqlTableCreates

Error: Could not find or load main class ExecJDBC Please give me a solution for this I trying for the last two days. I change Error my JDK path to JDK7.0 still get an Error

waterguo commented 3 years ago

It is because what you downloaded from github is source code instead of binary. You need to build the project first. Go to the root directory. Run "ant" command to build it giving you have already installed ant.

shivam2093 commented 3 years ago

Yes I already installed ant and run ant outside run folder then it creates .class file in build folder and other dist folder with benchmarks.jar file after when I ran run SQL.sh script file it gave me an error that class couldn't find.

waterguo commented 3 years ago

it looks really strange to me. but java 1.7 is really really really old. i suggest you try 1.8 at least. and also what version of linux are you using?

shivam2093 commented 3 years ago

Yes I have ran with JDK 8 but I don't have Linux system, I am running on windows should I run on Linux or virtualBox?

waterguo commented 3 years ago

that's a bad idea. my friend. use a linux vm to test at least. for real performance test, recommend bare metal.

shivam2093 commented 3 years ago

yes, I will use Linux OS but will that resolve the problem?

waterguo commented 3 years ago

i can help you make it work when i have time. i've never had any issues with either my fork of benchmarksql or the original benchmarksql. be noted i am using linux all the time.

shivam2093 commented 3 years ago

Yes sure because it is for my recent project and they want us to determine the performance of the database when thousands of data load into database. If it possible for you when I install Linux will let you know