-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics, Sharding
-
Fully Compatible
-
v3.6, v3.4
-
Query 2018-02-26, Query 2018-03-12, Query 2018-03-26
-
(copied to CRM)
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.
- is depended on by
-
SERVER-33462 Allow killop on a mongos op id
- Closed
-
SERVER-33283 Add test coverage for case where pinned cursor is killed after all calls to checkForInterrupt on mongos
- Closed
-
SERVER-33700 Adapt invalidate_cursors.js to run killOp and killCursors on active getMores on sharded clusters
- Closed
- is duplicated by
-
SERVER-28649 Create a currentRouterOps command in the mongos.
- Closed
-
SERVER-33268 Put description of command request into CurOp on mongos
- Closed
-
SERVER-25354 users on mongos should always be able to run currentOp and killOp on their own operations
- Closed
- related to
-
SERVER-32103 CTRL-C in mongo shell does not terminate long running ops if connected to mongos
- Backlog
-
SERVER-6496 provide a way to kill a sharded query on all shards
- Closed
-
SERVER-4984 make it possible to interrupt operations in mongos
- Closed
-
SERVER-33939 Improve logging in sharded clusters to show source application
- Closed