-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 3.9
-
Component/s: Wire Protocol
-
None
-
Environment:mac osx, linux
With pymongo 3.6, getMore requests do not explicitly set a readPreference. With version 3.9, getMore specifically sets readPreference to primary even when the connection sets secondary or secondaryPreferred. I didn't specifically test versions greater than 3.6 and less than 3.9, so I am not sure when this change was introduced.
Snippet to reproduce:
import pymongo client = pymongo.MongoClient(port=27017, readPreference="secondary") database = "db" collection_name = "has_more_than_101_documents" collection = client.db.collection_name docs = list(collection.find({}).limit(102)) print(len(docs))
With 3.6, the getMore contains no readPreference setting.
With 3.9, the getMore contains $readPreference mode:primary, even when the initial cursor set secondary.
Consider changing this behavior such that the getMore requests respect the readPreference set by the cursor.
- is caused by
-
PYTHON-1329 Support OP_MSG
- Closed
- related to
-
GODRIVER-2209 Do not include default read preference on cursor getMore and killCursors commands
- Closed