Per the Retryable Writes spec, unacknowledged writes should never be retried.
Also, the Sessions Spec says "a driver MUST NOT send a session ID with unacknowledged writes. This is true for both implicit and explicit sessions."
While testing PHPC with libmongoc 1.9.0-rc1, I discovered that libmongoc is still including transaction IDs in unacknowledged write commands. This is likely the result of _allow_txn_number() in mongoc-cmd.c failing to return to return false. We should be able to trust that the "writeConcern" field, if any, is already merged into the write command before _allow_txn_number() is called, so fixing this should only require _allow_txn_number() checking for w:0.
Additionally, this fix should catch the case where mongoc_cmd_parts_append_opts() merged in a "writeConcern" option (from a with_opts() function, or the user explicitly provided "writeConcern" in the original command document (as PHPLIB does through PHPC).
Finally, the driver MUST NOT include "lsid" (the logical session ID) in unacknowledged writes.
- is depended on by
-
DRIVERS-456 Prohibit using unacknowledged writes with explicit sessions
- Closed
-
PHPC-1126 Prohibit using unacknowledged writes with explicit sessions
- Closed
- is related to
-
CDRIVER-2366 Use OP_MSG for unacknowledged writes
- Closed
- related to
-
CDRIVER-2615 Do not allow a session to be used with an unacknowledged write concern
- Closed
-
PHPC-1341 Remove XFAIL for unacknowledged write concern test
- Closed