Skip to content

[Bug]: tpcc reports AssertionError: all_stocks len 9 != ol_cnt 10 when run with jepsen #332

@xiexiaoy

Description

@xiexiaoy
2025-11-24 21:35:07,468 [execute:072] WARNING: Failed to execute Transaction 'STOCK_LEVEL': 192.168.122.25:27017: connection closed (configured timeouts: connectTimeoutMS: 20000.0ms)
2025-11-24 21:35:07,469 [execute:072] WARNING: Failed to execute Transaction 'STOCK_LEVEL': 192.168.122.25:27017: connection closed (configured timeouts: connectTimeoutMS: 20000.0ms)
2025-11-24 21:35:07,469 [execute:072] WARNING: Failed to execute Transaction 'STOCK_LEVEL': 192.168.122.25:27017: connection closed (configured timeouts: connectTimeoutMS: 20000.0ms)
Traceback (most recent call last):
  File "/home/eloq/workspace/py-tpcc/pytpcc/runtime/executor.py", line 68, in execute
    (val, retries) = self.driver.executeTransaction(txn, params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/abstractdriver.py", line 105, in executeTransaction
    result = self.doNewOrder(params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 612, in doNewOrder
    (value, retries) = self.run_transaction_with_retries(self._doNewOrderTxn, "NEW_ORDER", params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1167, in run_transaction_with_retries
    (ok, value) = self.run_transaction(txn_callback, s, name, params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1140, in run_transaction
    return (True, txn_callback(session, params))
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 727, in _doNewOrderTxn
    assert len(all_stocks) == ol_cnt, "all_stocks len %d != ol_cnt %d" % (len(all_stocks), ol_cnt)
AssertionError: all_stocks len 9 != ol_cnt 10
Aborting some transaction with some error NEW_ORDER all_stocks len 9 != ol_cnt 10
ConnectionFailure during NEW_ORDER: 
Traceback (most recent call last):
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/pool.py", line 538, in command
    return command(
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/network.py", line 208, in command
    reply = receive_message(conn, request_id)
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/network.py", line 320, in receive_message
    length, _, response_to, op_code = _UNPACK_HEADER(_receive_data_on_socket(conn, 16, deadline))
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/network.py", line 404, in _receive_data_on_socket
    raise OSError("connection closed")
OSError: connection closed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/eloq/workspace/py-tpcc/pytpcc/runtime/executor.py", line 68, in execute
    (val, retries) = self.driver.executeTransaction(txn, params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/abstractdriver.py", line 111, in executeTransaction
    result = self.doStockLevel(params)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1048, in doStockLevel
    return (self._doStockLevelTxn(None, params), 0)
  File "/home/eloq/workspace/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1057, in _doStockLevelTxn
    result = list(self.district.aggregate([
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/collection.py", line 2958, in aggregate
    return self._aggregate(
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/_csot.py", line 119, in csot_wrapper
    return func(self, *args, **kwargs)
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/collection.py", line 2866, in _aggregate
    return self._database.client._retryable_read(
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 1863, in _retryable_read
    return self._retry_internal(
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/_csot.py", line 119, in csot_wrapper
    return func(self, *args, **kwargs)
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 1830, in _retry_internal
    ).run()
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 2559, in run
    self._check_last_error()
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 2638, in _check_last_error
    raise self._last_error
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 2554, in run
    return self._read() if self._is_read else self._write()
  File "/home/eloq/workspace/jepsen-eloqdoc/myenv/lib/python3.10/site-packages/pymongo/synchronous/mongo_client.py", line 2697, in _read
    return self._func(self._session, self._server, conn, read_pref)  # type: ignore

Metadata

Metadata

Assignees

No one assigned

    Labels

    EloqdocbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions