In PYTHON-2182 we updated PyMongo's Cursor class to use the namespace returned by the initial find command for running all subsequent getMore operations. However, we did not change how we close cursors server-side and as a result killCursors still uses the database.collection convention to specify the namespace in which to close cursors. This should be updated to follow the same logic as find/getMore.
For example, when running a find against Atlas Data Lake on a the test.driverdata collection, we get the following command response:
{'ok': 1, 'cursor': {'firstBatch': [{'a': 1, 'b': 2, 'c': 3}, {'a': 2, 'b': 3, 'c': 4}], 'id': 5, 'ns': 'cursors.ip-10-122-14-95-0a89e0bd-da01-4e9b-ae4e-91b40cd97495'}}
Upon closing the cursor, the outgoing killCursors command looks like this:
SON([('killCursors', 'driverdata'), ('cursors', [5]), ('lsid', {'id': Binary(b'\x9by\x86U\xda\xaeA\x1f\x87\xfd\xc3\xcb \xa4\xfb\xdd', 4)}), ('$db', 'test'), ('$readPreference', {'mode': 'primary'})])
Consequently, the server is unable to find and kill the cursor as evidenced by the killCursors command response:
{'ok': 1, 'cursorsKilled': [], 'cursorsNotFound': [5], 'cursorsAlive': [], 'cursorsUnknown': []}
- is related to
-
PYTHON-2182 Cursor namespace is ignored
- Closed
-
PYTHON-2318 Testing Data Lake with Drivers
- Closed
-
PYTHON-2475 Implement Atlas Data Lake prose tests
- Closed