-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
We have upgraded our database from mongo 2.6 to mongo 4.4.2. After upgrading to new database the queries which was taking 12 seconds in old version and now it is taking 41 seconds. We have revamped our code according to the new mongo 4.4.2 storage engine. Our mongo database is consists of 1 primary server and 2 secondary servers under replica set. Below are the whole details. We are using aws ec2 instances for all servers and Ubuntu 20.04.1 LTS OS. Please guide us to get rid of the issue
rs0:PRIMARY> rs.status()
{
"set" : "rs0",
"date" : ISODate("2021-07-14T05:25:57.294Z"),
"myState" : 1,
"term" : NumberLong(9),
"syncSourceHost" : "",
"syncSourceId" : -1,
"heartbeatIntervalMillis" : NumberLong(2000),
"majorityVoteCount" : 2,
"writeMajorityCount" : 2,
"votingMembersCount" : 3,
"writableVotingMembersCount" : 3,
"optimes" : {
"lastCommittedOpTime" :
,
"lastCommittedWallTime" : ISODate("2021-07-14T05:25:50.983Z"),
"readConcernMajorityOpTime" :
,
"readConcernMajorityWallTime" : ISODate("2021-07-14T05:25:50.983Z"),
"appliedOpTime" :
,
"durableOpTime" :
,
"lastAppliedWallTime" : ISODate("2021-07-14T05:25:50.983Z"),
"lastDurableWallTime" : ISODate("2021-07-14T05:25:50.983Z")
},
"lastStableRecoveryTimestamp" : Timestamp(1626240350, 1),
"electionCandidateMetrics" : {
"lastElectionReason" : "stepUpRequestSkipDryRun",
"lastElectionDate" : ISODate("2021-06-21T09:23:44.018Z"),
"electionTerm" : NumberLong(9),
"lastCommittedOpTimeAtElection" :
,
"lastSeenOpTimeAtElection" :
,
"numVotesNeeded" : 2,
"priorityAtElection" : 1,
"electionTimeoutMillis" : NumberLong(10000),
"priorPrimaryMemberId" : 1,
"numCatchUpOps" : NumberLong(0),
"newTermStartDate" : ISODate("2021-06-21T09:23:44.028Z"),
"wMajorityWriteAvailabilityDate" : ISODate("2021-06-21T09:23:46.211Z")
},
"members" : [
{
"_id" : 0,
"name" : "mongo-rs.follettdiscover.com:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 1973082,
"optime" :
,
"optimeDate" : ISODate("2021-07-14T05:25:50Z"),
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"electionTime" : Timestamp(1624267424, 1),
"electionDate" : ISODate("2021-06-21T09:23:44Z"),
"configVersion" : 1,
"configTerm" : 9,
"self" : true,
"lastHeartbeatMessage" : ""
},
{
"_id" : 1,
"name" : "mongo-rs1.follettdiscover.com:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 54098,
"optime" :
,
"optimeDurable" :
,
"optimeDate" : ISODate("2021-07-14T05:25:50Z"),
"optimeDurableDate" : ISODate("2021-07-14T05:25:50Z"),
"lastHeartbeat" : ISODate("2021-07-14T05:25:57.260Z"),
"lastHeartbeatRecv" : ISODate("2021-07-14T05:25:56.187Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncSourceHost" : "mongo-rs.follettdiscover.com:27017",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1,
"configTerm" : 9
},
{
"_id" : 2,
"name" : "mongo-rs2.follettdiscover.com:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 53847,
"optime" :
,
"optimeDurable" :
,
"optimeDate" : ISODate("2021-07-14T05:25:50Z"),
"optimeDurableDate" : ISODate("2021-07-14T05:25:50Z"),
"lastHeartbeat" : ISODate("2021-07-14T05:25:56.438Z"),
"lastHeartbeatRecv" : ISODate("2021-07-14T05:25:57.244Z"),
"pingMs" : NumberLong(1),
"lastHeartbeatMessage" : "",
"syncSourceHost" : "mongo-rs1.follettdiscover.com:27017",
"syncSourceId" : 1,
"infoMessage" : "",
"configVersion" : 1,
"configTerm" : 9
}
],
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1626240350, 1),
"signature" :
},
"operationTime" : Timestamp(1626240350, 1)
}
rs0:PRIMARY> rs.conf()
{
"_id" : "rs0",
"version" : 1,
"term" : 9,
"protocolVersion" : NumberLong(1),
"writeConcernMajorityJournalDefault" : true,
"members" : [
{
"_id" : 0,
"host" : "mongo-rs.follettdiscover.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 1,
"host" : "mongo-rs1.follettdiscover.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 2,
"host" : "mongo-rs2.follettdiscover.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
}
],
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" :
,
"replicaSetId" : ObjectId("5ffd7bff262aededdee0a08f")
}
}
rs0:PRIMARY> rs.printReplicationInfo()
configured oplog size: 990MB
log length start to end: 1280085secs (355.58hrs)
oplog first event time: Tue Jun 29 2021 09:50:15 GMT+0000 (UTC)
oplog last event time: Wed Jul 14 2021 05:25:00 GMT+0000 (UTC)
now: Wed Jul 14 2021 05:25:04 GMT+0000 (UTC)
rs0:PRIMARY> rs.printSecondaryReplicationInfo()
source: mongo-rs1.follettdiscover.com:27017
syncedTo: Wed Jul 14 2021 05:25:30 GMT+0000 (UTC)
0 secs (0 hrs) behind the primary
source: mongo-rs2.follettdiscover.com:27017
syncedTo: Wed Jul 14 2021 05:25:30 GMT+0000 (UTC)
0 secs (0 hrs) behind the primary