Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-965

Determine how to include transaction IDs in write commands

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Quoting some comments from the retryable writes spec document:

      Jeremy Mikola: 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.

      A. Jesse Jiryu Davis: 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().

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jmikola Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: