[CDRIVER-2370] Command monitoring and OP_MSG document sequences Created: 14/Nov/17  Updated: 28/Oct/23  Resolved: 04/Dec/17

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.9.0
Fix Version/s: 1.9.0

Type: New Feature Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-1038 "documents" key in "command" in APM's... Closed

 Description   

MongoDB 2.6 write commands have arrays called "documents", "updates", and "deletes" which contain the array of operations. These are absent from the command body with OP_MSG, and they're added as document sequences instead.

Introduce a new function mongoc_apm_command_started_get_document_sequences which returns these documents no matter what format of write command was sent to the server. The return value will be NULL if the command is not insert, update, or delete. Converse for command-succeeded events.

In libmongoc 1.9, when we send an OP_MSG with a document sequence to the server, simulate a command body that includes the document sequence as a BSON array in order to preserve the same API as OP_QUERY write commands.



 Comments   
Comment by Githook User [ 05/Dec/17 ]

Author:

{'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}

Message: CDRIVER-2370 fix forward decl for C99
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0dc8fb1aca4194df67afd431c55d438f9ecef56c

Comment by Githook User [ 05/Dec/17 ]

Author:

{'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}

Message: CDRIVER-2370 command monitoring for OP_MSG

New design: take the document sequence from an OP_MSG insert, update, or
delete and append it to a synthesized command document for monitoring.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d2b1589423ab6f687e1a3b234d85c37052495685

Comment by Githook User [ 05/Dec/17 ]

Author:

{'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}

Message: Revert "CDRIVER-2370 monitor OP_MSG document sequences"

This reverts commit 51c7384
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1c669926ddafe44443ea6e04080fa2e99c80893d

Comment by Githook User [ 05/Dec/17 ]

Author:

{'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}

Message: Revert "CDRIVER-2370 fix forward decl"

This reverts commit 34165fb
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b3e13101e0497d98d7d281bc7117dbd459726308

Comment by A. Jesse Jiryu Davis [ 23/Nov/17 ]

derick the outcome of the spec debate is that we'll maintain the pre-3.6 behavior. Documents that are actually kept separate in OP_MSG document sequences for "insert", "update", and "delete" commands will be included in the command document published with mongoc_apm_command_started_t. This should be implemented before 1.9.0, and PHPC won't need to make any changes to its Command Monitoring tests.

Comment by A. Jesse Jiryu Davis [ 20/Nov/17 ]

Reopening while a spec debate is resolved. And rename the simulated reply fields to cursor.firstBatch and cursor.nextBatch.

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2370 fix forward decl
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/34165fbbfd93a45646b60f74301002713b888351

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2370 monitor OP_MSG document sequences

Update Command Monitoring (also known as APM) to expose the document
sequence sent with an OP_MSG insert, update, or delete. Simulate a
document sequence if the wire protocol uses OP_QUERY commands instead
of OP_MSG.

In MongoDB 3.8 there will be document sequences in the OP_MSG reply to
"find", "aggregate", etc. Anticipate that wire protocol by simulating
a document sequence with command replies.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/51c7384fa41642623930daabbbb2a4fbb09471b2

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