[SERVER-48662] pytpcc fails against 4.2.7 Created: 09/Jun/20  Updated: 06/Dec/22  Resolved: 09/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Vadim Tkachenko Assignee: Backlog - Triage Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Triage
Operating System: ALL
Steps To Reproduce:
  1. clone https://github.com/mongodb-labs/py-tpcc
  2. run ./tpcc.py --config mconfig --warehouses 100 mongodb
Participants:

 Description   

When I try to run pytpcc from https://github.com/mongodb-labs/py-tpcc against server 4.2.7 server it fails with

./tpcc.py --config mconfig --warehouses 100 --no-load mongodb
2020-06-08 14:44:53,679 [<module>:245] INFO : Initializing TPC-C benchmark using MongodbDriver
2020-06-08 14:45:53,681 [<module>:282] INFO : Final Results
2020-06-08 14:45:53,681 [<module>:283] INFO : Threads: 1
{'DELIVERY': 317, 'ORDER_STATUS': 353, 'STOCK_LEVEL': 349, 'PAYMENT': 3581, 'NEW_ORDER': 3751}
Traceback (most recent call last):
 File "./tpcc.py", line 284, in <module>
 logging.info(results.show(load_time, driver, args['clients']))
 File "/home/vadim/scripts/py-tpcc/pytpcc/util/results.py", line 251, in show
 driver.save_result(result_doc)
 File "/home/vadim/scripts/py-tpcc/pytpcc/drivers/mongodbdriver.py", line 1146, in save_result
 self.client.test.results.save(self.result_doc)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 3158, in save
 to_save, True, check_keys, manipulate, write_concern)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 612, in _insert
 bypass_doc_val, session)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 600, in _insert_one
 acknowledged, _insert_command, session)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1491, in _retryable_write
 return self._retry_with_session(retryable, func, s, None)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1384, in _retry_with_session
 return func(session, sock_info, retryable)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 595, in _insert_command
 retryable_write=retryable_write)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/pool.py", line 618, in command
 self._raise_connection_failure(error)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/pool.py", line 613, in command
 user_fields=user_fields)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/network.py", line 129, in command
 codec_options, ctx=compression_ctx)
 File "/usr/local/lib/python2.7/dist-packages/pymongo/message.py", line 707, in _op_msg
 flags, command, identifier, docs, check_keys, opts)
bson.errors.InvalidDocument: key '$_internalSplitPipeline' must not start with '$'

 

it works without errors against 4.2.3 version

 

 



 Comments   
Comment by Asya Kamsky [ 09/Jun/20 ]

We backported SERVER-44689 to 4.2.6 and it's tracking aggregation stages (the first one of which is causing the failure) and that's why the document can't be inserted.

 

Comment by Vadim Tkachenko [ 09/Jun/20 ]

But why it fails with 4.2.7, but works fine with 4.2.3?

Comment by Carl Champain (Inactive) [ 09/Jun/20 ]

We are closing this ticket since this is not a bug with the MongoDB server.

Thanks,
Carl
 

Comment by Asya Kamsky [ 09/Jun/20 ]

vadim@percona.com the issue isn't with the server, it's that py-tpcc is saving result of serverStatus command and isn't stripping out all the fields that start with `$` (we sometimes backport diagnostics to minor releases).

You can comment out the line that's failing or in the method above delete the $ prefixed field that it's trying to save.    I don't think I came across this myself so it may be a function of what your cluster has in the server status document - I used those for debugging after the fact, so it's not actually impacting the run of PyTPCC.

Generated at Thu Feb 08 05:17:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.