Background and motivation
5.1+ servers do not support exhaust cursors over OP_QUERY. CDRIVER-4130 changed the exhaust cursor implementation to fallback to a non-exhaust cursor on 5.1 servers.
This is permitted by the Find, getMore and killCursors commands. specification:
Server version | Driver behavior |
---|---|
4.0 and earlier | Drivers MUST use legacy OP_QUERY. |
4.2 to 5.0 | Drivers SHOULD use OP_MSG but MAY use legacy OP_QUERY. |
5.1 and later | Drivers MUST only use OP_MSG. Alternatively, drivers MAY fallback to a non-exhaust cursor when an exhaust cursor is requested. |
See PyMongo for a reference implementation of Exhaust Cursors with OP_MSG: PYTHON-1636.
Scope
- Satisfy the "SHOULD" statement for server 4.2 to 5.0. Implement exhaust cursors with OP_MSG.
- Do not fallback to a non-exhaust cursors on 5.1.
- is related to
-
SERVER-62147 Exhaust query using the OP_QUERY protocol is broken when more than one getMore batch is required
- Closed
-
CDRIVER-4130 Allow exhaust cursor to fallback to normal cursor if server does not support OP_QUERY
- Closed
- related to
-
DRIVERS-535 Support Exhaust Cursor in OP_MSG
- Development Complete