Query is not killed when it is stopped
I reported this issue https://mongobooster.useresponse.com/topic/allow-identifying-a-long-running-or-stuck-query-and-killing-it# two years ago, but the problem is still there.
Right now, I'm using version 6.1.8 of NoSqlBooster for MongoDB against MongoDB 4.0.9. Here are the steps to reproduce:
1. Run a query against a collection that has tens of millions of large entries. Make sure your query doesn't hit an index.
2. In another tab, run the currentOpActiveAndRunningLongerThan3Secs template to confirm that your query is visible
3. Stop the original query in the first tab
4. In the second tab, run the currentOpActiveAndRunningLongerThan3Secs again to confirm that the query is still there
5. Run db.killOp() using the operationId you got at 4
6. Run the currentOpActiveAndRunningLongerThan3Secs one more time to confirm that the query is gone
What should happen: In step 4 you should no longer see the query. You stopped it in NoSqlBooser so the query should have been killed.
What happens instead: In step 4 you still see the query and you have to kill it manually.
Are you 100% sure you can't reproduce this issue? Unfortunately, I can't give you access to our MongoDB but please tell me what kind of logging I can enable for you to understand in the logs what is going wrong?
Please advice, I really want to get this fixed.
Please take a look at your MongoDB Server's log file to check whether the command (killOp) has been called. Please note, even if the command is called and OK is returned, it does not mean that the long query has been killed. According to MongoDB 's Doc, killOp reports success if it succeeded in marking the specified operation for termination. Operations may not actually be terminated until they reach an appropriate interruption point. Use $currentOp or db.currentOp() to confirm the target operation was terminated. https://docs.mongodb.com/manual/reference/command/killOp/index.html#example
After you press the stop button, NoSQLBooster will call db.killOp(). But MongoDB's killOp doesn't take effect immediately. if you call db.currentOp, you will find that the flag bit of killPending has flagged. currentOp.killPending Returns true if the operation is currently flagged for termination. When the operation encounters its next safe termination point, the operation will terminate.
Please take a look at your MongoDB Server's log file to check whether the command (killOp) has been called. Please note, even if the command is called and OK is returned, it does not mean that the long query has been killed. According to MongoDB 's Doc, killOp reports success if it succeeded in marking the specified operation for termination. Operations may not actually be terminated until they reach an appropriate interruption point. Use $currentOp or db.currentOp() to confirm the target operation was terminated. https://docs.mongodb.com/manual/reference/command/killOp/index.html#example
After you press the stop button, NoSQLBooster will call db.killOp(). But MongoDB's killOp doesn't take effect immediately. if you call db.currentOp, you will find that the flag bit of killPending has flagged. currentOp.killPending Returns true if the operation is currently flagged for termination. When the operation encounters its next safe termination point, the operation will terminate.
Replies have been locked on this page!