why Mongodb can not kill inactive operation?

635 views
Skip to first unread message

陆峰

unread,
Sep 16, 2013, 5:46:38 AM9/16/13
to mongod...@googlegroups.com
I want to kill some inactive operations, operation information like this

                {
                       "opid" : 231889001,
                       "active" : false,
                       "op" : "query",
                       "ns" : "test.info",
                       "query" : {
                               "_id" : {
                                       "$in" : [
                                               "abc",
                                               "efg",
                                       ]
                                }
                       },
                       "client" : "192.168.0.114:47274",
                       "desc" : "conn560",
                       "threadId" : "0x7f83d5138700",
                       "connectionId" : 560,
                       "waitingForLock" : false,
                       "killPending" : true,
                       "numYields" : 0,
                       "lockStats" : {
                               "timeLockedMicros" : {
                                       "r" : NumberLong(365),
                                       "w" : NumberLong(0)
                               },
                               "timeAcquiringMicros" : {
                                       "r" : NumberLong(2),
                                       "w" : NumberLong(0)
                               }
                       }
               }

and I use this command to kill this operation

> db.killOp(231889001)
{ "info" : "attempting to kill op" }



It seem not take any effect, this operation is still here. 

and I also check the read/write queue and currentOp(), did not find any command in queue and currentOp() is empty.

        "globalLock": {
            "lockTime": 130560173,
            "currentQueue": {
                "total": 0,
                "writers": 0,
                "readers": 0
            },
            "activeClients": {
                "total": 0,
                "writers": 0,
                "readers": 0
            },
            "totalTime": 282024131000
        },


> db.currentOp()
{ "inprog" : [ ] }


Question is:
1. if I want to kill these operations, what can I do? except restart MongoDB server.
2. Why there are so may operations are inactive? what has caused this problem?

Thanks.


Jeff Lee

unread,
Sep 16, 2013, 1:54:37 PM9/16/13
to mongod...@googlegroups.com
Do you have a lot of open cursors?  I believe they'll show up as inactive in db.currentOp(1) until you close them.

Kristina Chodorow did a good write-up on killing ops a while back.


--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

陆峰

unread,
Sep 16, 2013, 10:26:55 PM9/16/13
to mongod...@googlegroups.com
the highest is less than 10 cursors in server. currently there is nothing cursor in server but these operations still inactive and can not killed.

I check the document and she said one that die when they yield whatever lock they're holding, this means that if the op never yields (note that numYields is 0 in the example above), it will never be killed.  Maybe current operations in my MongoDB is dead, it will never be killed.

and Does this inactive operations ( never be killed) will occupy some of the space in hashtable in MongoDB? Is this a bug and I can open a Jira in MongoDB. 

thanks Jeffl


在 2013年9月17日星期二UTC+8上午1时54分37秒,jeffl写道:
Reply all
Reply to author
Forward
0 new messages