Skip to content

Commit 517ec1d

Browse files
committed
SPEC-1019 prohibit unack'd writes in a session
1 parent c703a55 commit 517ec1d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

source/sessions/driver-sessions.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,10 +620,23 @@ A session ID MUST NOT be used simultaneously by more than one operation. Since
620620
drivers don't wait for a response for an unacknowledged write a driver would
621621
not know when the session ID could be reused. In theory a driver could use a
622622
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.
627640

628641
Server Commands
629642
===============
@@ -1082,3 +1095,4 @@ Change log
10821095
:2018-01-10: Update test plan for drivers without APM
10831096
:2018-01-11: Clarify that sessions require replica sets or sharded clusters
10841097
: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

Comments
 (0)