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

APM reports incorrect command document for unacknowledged bulk writes

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.9.3
    • Component/s: Bulk API, libmongoc
    • None

      In mongodb/mongo-php-driver#780, a user was reporting some issues executing bulk updates with an unacknowledged write concern. Since he was connecting to a MongoDB 3.4 server, each update in the bulk write was issued in its own OP_UPDATE message. While investigating his script with APM, I noticed that executing a bulk write with five update statements resulted in five CommandStartedEvents; however, the command document attached to each CommandStartedEvent included the full bulk write. This made it appear as if 25 updates were being executed instead of five.

      I believe this may be due to _mongoc_write_command_update_legacy() calling _mongoc_monitor_legacy_write() with the full command struct instead of a synthetic command that contains the single statement being executed.

      If so, this is likely also an issue for _mongoc_write_command_delete_legacy() and _mongoc_write_command_insert_legacy() (depending how documents are split for each OP_INSERT) message).

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: