Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18094

currentOp on a mongoS should also show current mongoS operations

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.6, v3.4
    • Sprint:
      Query 2018-02-26, Query 2018-03-12, Query 2018-03-26
    • Case:

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: