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

Fix '--reset' and '--no-load' args combination #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

v1k1nghawk
Copy link

@v1k1nghawk v1k1nghawk commented Feb 13, 2023

From a logical point of view, it is not possible to specify '--reset' and '--no-load' arguments at the same time. The current py-tpcc code state allows this, causing the database to be dropped, the new database not being created, and the run phase starting on an non-existent database, resulting in a waterfall of errors. Based on this, it is proposed to introduce a check for the presence of a combination of these two arguments.

Command:

time ./tpcc.py --config mconfig --warehouses 1 --clients 1 --no-load --reset mongodb

Original behavior:
Log file:

02-10-2023 21:09:24 [<module>:242] INFO : Reseting database
02-10-2023 21:09:24 [loadConfig:314] INFO : Deleting database 'tpcc'
02-10-2023 21:09:24 [<module>:245] INFO : Initializing TPC-C benchmark using MongodbDriver
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'NEW_ORDER': Couldn't find district in new order w_id 1 d_id 7
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'NEW_ORDER': Couldn't find district in new order w_id 1 d_id 5
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'PAYMENT': Couldn't find district in payment w_id 1 d_id 10
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'NEW_ORDER': Couldn't find district in new order w_id 1 d_id 8
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'PAYMENT': Couldn't find district in payment w_id 1 d_id 5
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'NEW_ORDER': Couldn't find district in new order w_id 1 d_id 6
02-10-2023 21:09:24 [execute:072] WARNING: Failed to execute Transaction 'NEW_ORDER': Couldn't find district in new order w_id 1 d_id 7
...

Output:

None 1 4 1457.57 1 4 787 None 2023-02-10 21:09:56.928609
Traceback (most recent call last):
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/runtime/executor.py", line 68, in execute
    (val, retries) = self.driver.executeTransaction(txn, params)
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/drivers/abstractdriver.py", line 109, in executeTransaction
    result = self.doPayment(params)
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 865, in doPayment
    (value, retries) = self.run_transaction_with_retries(self._doPaymentTxn, "PAYMENT", params)
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1117, in run_transaction_with_retries
    (ok, value) = self.run_transaction(txn_callback, s, name, params)
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1090, in run_transaction
    return (True, txn_callback(session, params))
  File "/home/ubuntu/TPCC/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 895, in _doPaymentTxn
    assert d, "Couldn't find district in payment w_id %d d_id %d" % (w_id, d_id)
AssertionError: Couldn't find district in payment w_id 1 d_id 4
Aborting some transaction with some error PAYMENT Couldn't find district in payment w_id 1 d_id 4
...

Suggested behavior:

Traceback (most recent call last):
  File "./tpcc.py", line 219, in <module>
    "'--reset' and '--no-load' are incompatible with each other"
AssertionError: '--reset' and '--no-load' are incompatible with each other

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 this pull request may close these issues.

1 participant