-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.4.0
-
Component/s: None
-
None
Per the Driver Session spec:
Therefore drivers MUST NOT send a session ID with unacknowledged writes under any circumstances:
- For unacknowledged writes with an explicit session, drivers SHOULD raise an error. If a driver allows users to provide an explicit session with an unacknowledged write (e.g. for backwards compatibility), the driver MUST NOT send the session ID.
- For unacknowledged writes without an explicit session, drivers SHOULD NOT use an implicit session. If a driver creates an implicit session for unacknowledged writes without an explicit session, the driver MUST NOT send the session ID.
Drivers MUST document the behavior of unacknowledged writes for both explicit and implicit sessions.
PHPC-1152 added logic to create an implicit session for executeCommand() (and related methods). If an unacknowledged write concern is passed, we should ensure that an implicit session is not created for the command.
Two edge cases remain, but should be tested:
- If the user calls executeReadWriteCommand() or executeWriteCommand() with or without a session option and without a write concern, it's possible that libmongoc may still inherit an unacknowledged write concern from the manager. We can try to check that in PHPC, but that's likely better fixed in libmongoc.
- PHPC has no logic to create implicit sessions for executeBulkWrite(); however, we should check if libmongoc correctly disallows executing a bulk write with an unknowledged write concern (either explicitly provided or inherited from the manager) and a session (either explicitly provided or implicitly generated by libmongoc).
- is related to
-
PHPC-1152 Aggregate may fail to use the same session for getMore commands
- Closed
- related to
-
CDRIVER-2615 Do not allow a session to be used with an unacknowledged write concern
- Closed
-
PHPC-1126 Prohibit using unacknowledged writes with explicit sessions
- Closed
-
PHPC-2036 Remove outdated prose test in causal consistency spec
- Closed