@@ -620,10 +620,23 @@ A session ID MUST NOT be used simultaneously by more than one operation. Since
620
620
drivers don't wait for a response for an unacknowledged write a driver would
621
621
not know when the session ID could be reused. In theory a driver could use a
622
622
new session ID for each unacknowledged write, but that would result in many
623
- orphaned sessions building up at the server. Rather than prohibit using
624
- unacknowledged writes with sessions we choose instead to specify that a driver
625
- MUST NOT send a session ID with unacknowledged writes. This is true for both
626
- implicit and explicit sessions.
623
+ orphaned sessions building up at the server.
624
+
625
+ Therefore drivers MUST NOT send a session ID with unacknowledged writes under
626
+ any circumstances:
627
+
628
+ * For unacknowledged writes with an explicit session, drivers SHOULD raise an
629
+ error. If a driver allows users to provide an explicit session with an
630
+ unacknowledged write (e.g. for backwards compatibility), the driver MUST NOT
631
+ send the session ID.
632
+
633
+ * For unacknowledged writes without an explicit session, drivers SHOULD NOT use
634
+ an implicit session. If a driver creates an implicit session for
635
+ unacknowledged writes without an explicit session, the driver MUST NOT send
636
+ the session ID.
637
+
638
+ Drivers MUST document the behavior of unacknowledged writes for both explicit
639
+ and implicit sessions.
627
640
628
641
Server Commands
629
642
===============
@@ -1082,3 +1095,4 @@ Change log
1082
1095
:2018-01-10: Update test plan for drivers without APM
1083
1096
:2018-01-11: Clarify that sessions require replica sets or sharded clusters
1084
1097
:2018-02-20: Add implicit/explicit session tests
1098
+ :2018-02-20: Drivers SHOULD error if unacknowledged writes are used with sessions
0 commit comments