-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.13.0
-
Component/s: None
When the driver has a write concern of 0 it does not apply the lsid to any initial command, including reads. This causes issues with cursors as the initial find command does not have an lsid attached but the subsequent getMore commands do. This causes an error on the server: "Cannot run getMore on cursor x, which was not created in a session...".
Steps to reproduce:
- Create a client with writeConcern 0.
- Insert documents into a collection more than the default batch size
- Execute collection.find({}).toArray() to run the find and at least one getMore
The sessions spec states the lsid MUST be sent on all commands with 1 exception being unacknowledged writes - the driver is improperly treating reads the same here: https://github.com/mongodb/node-mongodb-native/blob/main/src/sessions.ts#L960
Open question: What should be the behaviour for the generic run command?
- is cloned by
-
NODE-5044 Write Concern 0 Must Not Affect Read Operations [5.x]
- Closed