Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3324

Session not pinned to mongos when not relying on server selection

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.1
    • Affects Version/s: 1.15.0
    • Component/s: None
    • Labels:
      None

      When providing the _mongoc_client_command_with_opts function with a server_id in opts, mongoc_cluster_stream_for_server is called directly, skipping server selection logic contained in _mongoc_cluster_select_server_id. However, this also bypasses session pinning when using sharded transactions. The pinning should happen regardless of who performs server selection. Fixing this by pinning in mongoc_cluster_stream_for_server instead of during server selection also resolves a similar issue when providing a server_id option to the mongoc_bulk_operation_execute and _mongoc_cursor_fetch_stream functions.

      The rationale behind this is that the PHP driver performs server selection itself before issuing commands, as it needs to know which server a command ran on for result cursors and write result objects.

            Assignee:
            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: