I am just curious to know how did we understand the problem is bcos of writeconcern:majority?
The log information is this with respect to replication status right and how do we know that insert is triggered by app team with writeconcern:majority?
APart from increasing oplog size , what is the other way to solve replication lag as I ,am seeing 19 hours of delay.
MON_P1:SECONDARY> db.getReplicationInfo()
{
"logSizeMB" : 4000000,
"usedMB" : 2789244.36,
"timeDiff" : 75363,
"timeDiffHours" : 20.93,
"tFirst" : "Wed Jan 27 2021 05:24:46 GMT+0000 (GMT)",
"tLast" : "Thu Jan 28 2021 02:20:49 GMT+0000 (GMT)",
"now" : "Thu Jan 28 2021 21:34:14 GMT+0000 (GMT)"
}
MON_P1:SECONDARY> rs.printSlaveReplicationInfo()
source: yyy.com:23011
syncedTo: Thu Jan 28 2021 02:20:52 GMT+0000 (GMT)
69216 secs (19.23 hrs) behind the primary
MON_P1:SECONDARY>
We are at 3.6.18 version.
MON_P1:SECONDARY> rs.config()
{
"_id" : "MON_P1",
"version" : 8,
"protocolVersion" : NumberLong(1),
"members" : [
{
"_id" : 0,
"host" : "xxx.com:23011",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 1,
"host" : "yyy.com:23011",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 0.9,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 2,
"host" : "zzz.com:23011",
"arbiterOnly" : true,
"buildIndexes" : true,
"hidden" : false,
"priority" : 0,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
}
],
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("7y1f63996l8693a4196l7aq1")
}
}
MON_P1:SECONDARY> rs.status()
{
"set" : "MON_P1",
"date" : ISODate("2021-01-28T21:28:03.245Z"),
"myState" : 2,
"term" : NumberLong(30),
"syncingTo" : "xxx.com:23011",
"syncSourceHost" : "xxx.com:23011",
"syncSourceId" : 0,
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"appliedOpTime" : {
"ts" : Timestamp(1611800325, 36),
"t" : NumberLong(29)
},
"durableOpTime" : {
"ts" : Timestamp(1611800325, 36),
"t" : NumberLong(29)
}
},
"members" : [
{
"_id" : 0,
"name" : "xxx.com:23011",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 5710,
"optime" : {
"ts" : Timestamp(1611869283, 4),
"t" : NumberLong(30)
},
"optimeDurable" : {
"ts" : Timestamp(1611869282, 4),
"t" : NumberLong(30)
},
"optimeDate" : ISODate("2021-01-28T21:28:03Z"),
"optimeDurableDate" : ISODate("2021-01-28T21:28:02Z"),
"lastHeartbeat" : ISODate("2021-01-28T21:28:03.235Z"),
"lastHeartbeatRecv" : ISODate("2021-01-28T21:28:02.348Z"),
"pingMs" : NumberLong(39),
"lastHeartbeatMessage" : "",
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"electionTime" : Timestamp(1611863472, 1),
"electionDate" : ISODate("2021-01-28T19:51:12Z"),
"configVersion" : 8
},
{
"_id" : 1,
"name" : "yyy.com:23011",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 5762,
"optime" : {
"ts" : Timestamp(1611800325, 36),
"t" : NumberLong(29)
},
"optimeDate" : ISODate("2021-01-28T02:18:45Z"),
"syncingTo" : "xxx.com:23011",
"syncSourceHost" : "xxx.com:23011",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 8,
"self" : true,
"lastHeartbeatMessage" : ""
},
{
"_id" : 2,
"name" : "zzz.com:23011",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 5710,
"lastHeartbeat" : ISODate("2021-01-28T21:28:02.711Z"),
"lastHeartbeatRecv" : ISODate("2021-01-28T21:28:02.909Z"),
"pingMs" : NumberLong(29),
"lastHeartbeatMessage" : "",
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"configVersion" : 8
}
],
"ok" : 1,
"operationTime" : Timestamp(1611800325, 36),
"$clusterTime" : {
"clusterTime" : Timestamp(1611869283, 4),
"signature" : {
"hash" : BinData(0,"mKHbJ/3jBavaMoNjluLlbQFQOqc="),
"keyId" : NumberLong("6883968148895170561")
}
}
}