[SERVER-19567] Compatibility layer for display of find/getMore commands in currentOp Created: 23/Jul/15  Updated: 15/Oct/15  Resolved: 07/Oct/15

Status: Closed
Project: Core Server
Component/s: Diagnostics, Querying
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: J Rassi Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-19566 Profiler format changes for the find/... Closed
Backwards Compatibility: Fully Compatible
Sprint: Quint Iteration 7, QuInt A (10/12/15)
Participants:

 Description   

Same as SERVER-19566, but for currentOp. Copying below the description of that ticket:

Profiling a find command should generate a document in the system.profile collection of the same schema as a legacy find operations. We should also consider adding an extra field to the profile entry indicating whether a find command or a legacy find was used.

The same work should be done for the getMore command.



 Comments   
Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-19567 make OP_QUERY currentOp entries look like find commands
Branch: master
https://github.com/mongodb/mongo/commit/e087223cbc0f6199c48030b49d02b2ebd5497a6c

Comment by David Storch [ 23/Sep/15 ]

Re-opening this ticket pending some incomplete work. In SERVER-19566, we changed the "query" field of the profiler entry to look like the find command parameters object, regardless of whether the query was delivered as a legacy OP_QUERY or as a find command. We should consider doing similar work for currentOp().

Currently, the "query" field in currentOp will look different depending on the readMode. Consider the query db.foo.find({a:1}, {_id:1}).limit(5).skip(2).batchSize(1) issued from the shell. With --readMode compatibility, the currentOp entry will look like this:

"op" : "query",
"ns" : "test.foo",
"query" : {
    "a" : 1
},

With --readMode commands, on the other hand, it will look like this:

"op" : "query",
"ns" : "test.foo",
"query" : {
    "find" : "foo",
    "filter" : {
        "a" : 1
    },
    "skip" : 2,
    "batchSize" : 1,
    "limit" : 5,
    "singleBatch" : false,
    "projection" : {
        "_id" : 1
    }
},

It would be nice to "upconvert" the currentOp entry for a legacy OP_QUERY in order to look the same as a find command.

Comment by Githook User [ 07/Aug/15 ]

Author:

{u'username': u'coollog', u'name': u'Qingyang Chen', u'email': u'qingyang.chen@10gen.com'}

Message: SERVER-19567 Compatibility layer for display of find/getMore commands in currentOp
Branch: master
https://github.com/mongodb/mongo/commit/d7449f03b4aca1d42b410871175504c651691d41

Generated at Thu Feb 08 03:51:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.