johnlpage / POCDriver

Workload Driver for MongoDB in Java
Other
204 stars 87 forks source link

Failing with MongoDB 5.0 (Unsupported OP_QUERY) #47

Closed etienneptl closed 3 years ago

etienneptl commented 3 years ago

Hi ! Thank you for this tool @johnlpage, been useful. However, it is now failing when using it along with the last version of MongoDB on the master branch (d356d2ed92812367bb2f61495f2ec064cad5a021).

Error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "../many-collection-test.py", line 589, in populate_collections_worker
    bulk.execute()
  File "/usr/local/lib/python3.6/dist-packages/pymongo/bulk.py", line 675, in execute
    return self.__bulk.execute(write_concern)
  File "/usr/local/lib/python3.6/dist-packages/pymongo/bulk.py", line 493, in execute
    return self.execute_command(sock_info, generator, write_concern)
  File "/usr/local/lib/python3.6/dist-packages/pymongo/bulk.py", line 319, in execute_command
    run.ops, True, self.collection.codec_options, bwc)
  File "/usr/local/lib/python3.6/dist-packages/pymongo/message.py", line 581, in write_command
    reply = self.sock_info.write_command(request_id, msg)
  File "/usr/local/lib/python3.6/dist-packages/pymongo/pool.py", line 548, in write_command
    helpers._check_command_response(result)
  File "/usr/local/lib/python3.6/dist-packages/pymongo/helpers.py", line 210, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: Unsupported OP_QUERY command: insert
"""

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

Traceback (most recent call last):
  File "../many-collection-test.py", line 754, in <module>
    populate_collections(num_collections, docs_per, multiprocessing.cpu_count())
  File "../many-collection-test.py", line 614, in populate_collections
    p.map(populate_collections_worker, pop_workers)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
pymongo.errors.OperationFailure: Unsupported OP_QUERY command: insert

According to the docs, seems that OP_QUERY has been deprecated (see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#request-opcodes)

johnlpage commented 3 years ago

Hi, I'm not sure what you are running here but it appears to be a python script called many-collection-test.py not POCDriver, there is no such python script as part fo the POCDriver source (it's all Java) . It's very likely that your copy of pymongo is long out of date and that's why your script is failing.