I have setup a mongo replicaSet on three different machines. When I run rs.status(), I receive the following:
{
"set" : "rep0",
"date" : ISODate("2014-01-23T16:21:31Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "frankenstein.chocolate.worker.0:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 589,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"self" : true
},
{
"_id" : 1,
"name" : "frankenstein_worker_1:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 586,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"lastHeartbeat" : ISODate("2014-01-23T16:21:29Z"),
"lastHeartbeatRecv" : ISODate("2014-01-23T16:21:31Z"),
"pingMs" : 5,
"syncingTo" : "frankenstein_worker_2:27017"
},
{
"_id" : 2,
"name" : "frankenstein_worker_2:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 584,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"lastHeartbeat" : ISODate("2014-01-23T16:21:31Z"),
"lastHeartbeatRecv" : ISODate("2014-01-23T16:21:30Z"),
"pingMs" : 5,
"syncingTo" : "frankenstein.chocolate.worker.0:27017"
}
],
"ok" : 1
}
Everything seems to be running fine and all machines are up to date. Yet, when I view the oplog, the same query from one of the secondary machines is occurring every minute. Here is one sample of those queries:
{
"opid" : 5315,
"active" : true,
"secs_running" : 1770,
"op" : "query",
"ns" : "local.oplog.rs",
"query" : {
"$query" : {
"$and" : [
{
"$or" : [
{
"ns" : "callcenter_analysis_db.documents"
},
{
"ns" : "callcenter_analysis_db.$cmd"
}
]
},
{
"ts" : {
"$gt" : Timestamp(1390112416, 15)
}
}
]
},
"$orderby" : {
"$natural" : 1
}
},
"client" : "xxx.xxx.xx.157:58079",
"desc" : "conn174",
"threadId" : "0x7f460f4db700",
"connectionId" : 174,
"locks" : {
"^" : "r",
"^local" : "R"
},
Each query is exactly the same including the timestamp (secs_running has a period of 60). This query is only coming from client "xxx.xxx.xx.157". Due to the multiple occurrences of this query, mongo is really bogging down the machine.
Some other potential useful info:
rep0:PRIMARY> db.printSlaveReplicationInfo()
source: frankenstein_worker_1:27017
syncedTo: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
= 6449 secs ago (1.79hrs)
source: frankenstein_worker_2:27017
syncedTo: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
= 6450 secs ago (1.79hrs)
rep0:PRIMARY> db.printReplicationInfo()
configured oplog size: 12572.1033203125MB
log length start to end: 721324secs (200.37hrs)
oplog first event time: Wed Jan 15 2014 01:06:11 GMT-0600 (CST)
oplog last event time: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
now: Thu Jan 23 2014 11:17:42 GMT-0600 (CST)
Appreciate any help or clues of where to look. Thanks!