[SERVER-2356] mongos currentOp needs to map s client to d client Created: 13/Jan/11  Updated: 23/Jul/19  Resolved: 23/Jul/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Eliot Horowitz (Inactive) Assignee: Asya Kamsky
Resolution: Done Votes: 1
Labels: gm-ack, query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Flagging for re-triage. If I'm interpreting the title correctly, this relates to our recent conversations about adding ways to correlate parent ops with their children, a common case of this being correlating the part of a query running on mongos with the part running on the shards.



 Comments   
Comment by Asya Kamsky [ 23/Jul/19 ]

This is already available in current version (4.2).

Running currentOp on mongos shows all operations on individual shards, with information which mongos originated the command (along with client information from original client:

               {
                        "shard" : "shard01",
                        "type" : "op",
                        "host" : "client-2:30001",
                        "desc" : "conn2999",
                        "connectionId" : 2999,
                        "client_s" : "127.0.0.1:41918",
                        "appName" : "MongoDB Shell",
                        "clientMetadata" : {
                                "application" : {
                                        "name" : "MongoDB Shell"
                                },
                                "driver" : {
                                        "name" : "MongoDB Internal Client",
                                        "version" : "4.2.0-rc2"
                                },
                                "os" : {
                                        "type" : "Linux",
                                        "name" : "Ubuntu",
                                        "architecture" : "x86_64",
                                        "version" : "16.04"
                                },
                                "mongos" : {
                                        "host" : "client-2:30000",
                                        "client" : "127.0.0.1:36642",
                                        "version" : "4.1.11-61-g7e1682c"
                                }
                        },
                        "active" : true,
                        "currentOpTime" : "2019-07-23T17:09:53.369+0000",
                        "opid" : "shard01:25413194",
                        "lsid" : {
                                "id" : UUID("5431138f-45dc-4961-80f5-a94c77aa9c3e"),
                                "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
                        },
                        "secs_running" : NumberLong(0),
                        "microsecs_running" : NumberLong(348),
                        "op" : "getmore",
                        "ns" : "admin.$cmd",
                        "command" : {
                                "getMore" : NumberLong("7335767082014087962"),
                                "collection" : "$cmd.aggregate",
                                "lsid" : {
                                        "id" : UUID("5431138f-45dc-4961-80f5-a94c77aa9c3e"),
                                        "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
                                },
                                "$clusterTime" : {
                                        "clusterTime" : Timestamp(1563901793, 1),
                                        "signature" : {
                                                "hash" : BinData(0,"mdvursFgsA1mcuhUwDOtyqg2aWw="),
                                                "keyId" : NumberLong("6689449569685602333")
                                        }
                                },
                                "$client" : {
                                        "application" : {
                                                "name" : "MongoDB Shell"
                                        },
                                        "driver" : {
                                                "name" : "MongoDB Internal Client",
                                                "version" : "4.2.0-rc2"
                                        },
                                        "os" : {
                                                "type" : "Linux",
                                                "name" : "Ubuntu",
                                                "architecture" : "x86_64",
                                                "version" : "16.04"
                                        },
                                        "mongos" : {
                                                "host" : "client-2:30000",
                                                "client" : "127.0.0.1:36642",
                                                "version" : "4.1.11-61-g7e1682c"
                                        }
                                },
                                "$configServerState" : {
                                        "opTime" : {
                                                "ts" : Timestamp(1563901788, 1),
                                                "t" : NumberLong(17)
                                        }
                                },
                                "$db" : "admin"
                        },
                        "cursor" : { ... }
    etc...
    }
 

Comment by Gregory McKeon (Inactive) [ 25/Jan/18 ]

Sending to Query since we think they're currently working on this.

Comment by auto [ 25/Jan/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: cleaning sharding curop a bit - prep for SERVER-2356
https://github.com/mongodb/mongo/commit/feb971d07c3e0bfc32c7961b9f91be18e71f71ef

Generated at Thu Feb 08 02:59:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.