How to find a query for known cursor?

150 views
Skip to first unread message

Alexander

unread,
May 19, 2017, 9:53:28 AM5/19/17
to mongodb-user
Hi.

We have sharderd cluster v 3.2.9 with 5 shards. All shards are replicasets.

Can't finish balancing the collection because of an error:

2017-05-19T15:33:21.503+0300 I SHARDING [RangeDeleter] waiting for open cursors before removing range [{ _id: 5516784214296475900 }, { _id: 5532525526374540775 }) in db.products, elapsed secs: 45624, cursor ids: [180638098341, 181006835590, 181151392546, 181299571662, 181433804517, 181584039831, 181600892485, 181989452456, 182141990102, 182188270843, 182268287024, 182345344122, 182491077347, 182550541114, 182662194063, 182996925631, 183055409434, 183196283634, 183369900877, 183583055252, 183628296065, 183743060641, 183786051152, 184287753548, 184483170932]

I can't see in db.currentOp() any operation continuing so long. How to find a query for known cursor? i'm try to identify problem queries which hold data from deletion.

Thx.

Rupa Narayanan

unread,
May 30, 2017, 8:02:29 PM5/30/17
to mongodb-user
Hi Alexander,

We have an open feature request, SERVER-3090 which would help address your question, i.e., understanding the query associated with the cursor you are using. Please watch (and upvote) this ticket so that you receive updates.
Please note by default, MongoDB will close a cursor if there's 10 minutes (600000 milliseconds) of inactivity. This is set using the cursorTimeoutMillis parameter, to remove any idle cursors. So in your instance it might be possible that the application has an open cursor with no timeout setting. If the application crashes, the cursor will hang around forever, never closed by MongoDB. To address these scenarios, please restart the server  to clear out zombie cursors.

Regards,
Rupa
Reply all
Reply to author
Forward
0 new messages