-
Type: Task
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Quoting some comments from the retryable writes spec document:
jmikola: In the case of PHPLIB, PHPC and libmongoc, where we have a single code path for executing commands, do you expect libmongoc to introspect write command documents and inject the transaction ID? If not, we'll need libmongoc to provide some way for the PHP driver to get the session ID and incrementing counter so we can incorporate it into our own write commands.
This is also relevant for aggregate and $out, if this spec requires drivers to toss a transaction ID into any write command and let the server decide how to handle it.
jesse: Can you please use mongoc_client_write_command_with_opts, mongoc_client_read_write_command_with_opts, or one of the functions related to that in the libmongoc API? Then we can have simple logic in libmongoc: if the function has "write_command" in the name and it's in a session with retryWrites=true, include the transactionid.
PHPC does not maintain a list of write commands, so conditionally using mongoc_client_write_command_with_opts() may not be feasible. We should investigate whether all commands can be routed through mongoc_client_read_write_command_with_opts().
- depends on
-
CDRIVER-2228 All writes retryable support
- Closed
-
PHPC-834 Add Read, ReadWrite, and Write command execute methods
- Closed
- is related to
-
PHPC-986 All writes retryable support
- Closed