[SERVER-71607] $currentOp not display any session when not add getSiblingDB('admin') Created: 24/Nov/22  Updated: 25/Nov/22  Resolved: 24/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.12
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: jing xu Assignee: Edwin Zhou
Resolution: Done Votes: 0
Labels: Bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

hi:
mongodb is sharding cluster.
when i execute db.aggreagte([{$currentOp:{allUsers:true}}])
not display any session on current db is admin.
when i add getSiblingDB('admin') it is work well.

the following is result:so is it a bug for it ?
mongos> db
amdin
mongos> db.aggregate([{$currentOp:{allUsers:true}},{$match:{msg:{$regex:"^Index"}}},{$project:{shard:1,op:1,msg:1}}])
mongos> db.getSiblingDB('admin').aggregate([{$currentOp:{allUsers:true}},{$match:{msg:{$regex:"^Index"}}},{$project:{shard:1,op:1,msg:1}}])

{ "shard" : "shard4", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1149663253/1313591868 87%" } { "shard" : "shard7", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1213428254/1302083375 93%" } { "shard" : "shard2", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1136706581/1300855813 87%" } { "shard" : "shard8", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 805790473/1301249397 61%" } { "shard" : "shard6", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1184817591/1301305254 91%" } { "shard" : "shard5", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1190047539/1306673254 91%" } { "shard" : "shard3", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1138145372/1303734226 87%" } { "shard" : "shard1", "op" : "command", "msg" : "Index Build: scanning collection Index Build: scanning collection: 1048140154/1304149579 80%" }

mongos> db
amdin



 Comments   
Comment by jing xu [ 25/Nov/22 ]

hi Edwin Zhou:
I'm sorry.

Comment by Edwin Zhou [ 24/Nov/22 ]

Hi 601290552@qq.com,

Assuming that the output you have in your description is copy and pasted, it appears you have a typo for the admin database you're trying to collect $currentOp from.

mongos> db
amdin // should be 'admin'

Please try the following before executing the aggregation:

use admin

If you're still hitting this issue, we'd like to encourage you to start by asking our community for help by posting on the MongoDB Developer Community Forums.

If the discussion there leads you to suspect a bug in the MongoDB server, then we'd want to investigate it as a possible bug here in the SERVER project.

Best,
Edwin

Generated at Thu Feb 08 06:19:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.