[CDRIVER-2573] APM reports incorrect command document for unacknowledged bulk writes Created: 27/Mar/18  Updated: 07/Mar/23

Status: Backlog
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.9.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3035 Always allow bulk OP_INSERTs to accom... Closed

 Description   

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).


Generated at Wed Feb 07 21:15:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.