Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11566

Docs for SERVER-18094: currentOp on a mongoS should also show current mongoS operations

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Documentation Request Summary:

      No documentation summary in engineering ticket

      Scope of changes:

      Add 'localOps' parameter to $currentOp

      note Currently, we don't drill down int o clientMetadata output field which has info on the connected mongos.

      Impact to other docs outside of this product:

      MVP:

      Resources:

      Engineering Ticket Description:

      When there is a long running operation in a sharded cluster, if you run currentOp() on the mongoS, you can see the shard operations:

      		{
      			"desc" : "conn6",
      			"threadId" : "0x7ff5c34124b0",
      			"connectionId" : 6,
      			"opid" : "shard01:26",
      			"active" : true,
      			"secs_running" : 6,
      			"microsecs_running" : NumberLong(6237133),
      			"op" : "query",
      			"ns" : "test",
      			"query" : {
      				"$eval" : function () { for(i=0; i<5; i++) { db.bar.findOne(); sleep(10000)}}
      			},
      			"client_s" : "10.8.1.231:52889",
      			"numYields" : 0,
      			"locks" : {
      				"Global" : "W",
      				"MMAPV1Journal" : "w"
      			},
      			"waitingForLock" : false,
      			"lockStats" : {
      				"Global" : {
      					"acquireCount" : {
      						"r" : NumberLong(2),
      						"W" : NumberLong(1)
      					}
      				},
      				"MMAPV1Journal" : {
      					"acquireCount" : {
      						"w" : NumberLong(1)
      					}
      				},
      				"Database" : {
      					"acquireCount" : {
      						"r" : NumberLong(2)
      					}
      				},
      				"Collection" : {
      					"acquireCount" : {
      						"R" : NumberLong(2)
      					}
      				}
      			}
      		},
      

      While it's possible to tell which mongoS it came from, it's not possible to trace it back further unless you have verbose logging on the mongoS. It would be nice to be able to find the source of the long running operation directly from currentOp output.

      If you are running a query, you could use $comment to annotate the query. However for other operations (writes, commands, internal things like chunk migrations, etc) there is no such feature.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              5 years, 46 weeks, 6 days ago