I have a mongo instance running with oplogMinRetentionHours set to 24 hours and max oplog size set to 50G. But despite this config settings oplog entries seem to be withhold indefinitely since oplog has entries past 24 hours and oplog size has reached 1.4 TB and .34 TB on disk
db.runCommand( { serverStatus: 1 } ).oplogTruncation.oplogMinRetentionHours
24 hrs
OS: Windows Server 2016 DataCenter 64bit
db.getReplicationInfo()
{
"logSizeMB" : 51200,
"usedMB" : 1464142.51,
"timeDiff" : 3601538,
"timeDiffHours" : 1000.43,
"tFirst" : "Fri Mar 19 2021 14:15:49 GMT+0000 (Greenwich Mean Time)",
"tLast" : "Fri Apr 30 2021 06:41:27 GMT+0000 (Greenwich Mean Time)",
"now" : "Fri Apr 30 2021 06:41:28 GMT+0000 (Greenwich Mean Time)"
}
MongoDB server version: 4.4.0
what I have noticed is event with super user with root role is not able to access replset.oplogTruncateAfterPoint , not sure if this is by design
mongod.log
{“t”:{“$date”:“2021-04-30T06:35:51.308+00:00”},“s”:“I”, “c”:“ACCESS”, “id”:20436, “ctx”:“conn8”,“msg”:“Checking authorization failed”,“attr”:{“error”:{“code”:13,“codeName”:“Unauthorized”,“errmsg”:“not authorized on local to execute command { aggregate: “replset.oplogTruncateAfterPoint”, pipeline: [ { $indexStats: {} } ], cursor: { batchSize: 1000.0 }, $clusterTime: { clusterTime: Timestamp(1619764547, 1), signature: { hash: BinData(0, 180A28389B6BBA22ACEB5D3517029CFF8D31D3D8), keyId: 6935907196995633156 } }, $db: “local” }”}}}
Not sure why mongo would not delete older entries from oplog?
Also have posted in StackOverflow