Hi Aasawari,
I see its happening on both Primary and Secondary. We dont read anything from oplog directly.
After we switched to mongodb4.2 (no changes from the client side as we uses compatible driver 3.12.9) , we see the query response is going crazy. We are trying to see what are the contributing factors and we see these queries are taking more time. Also we started to see IDHACK which suppose to be an optimized query that also taking mre time due to this.
/var/log/mongodb-27951.log:2022-11-16T04:37:35.348+0000 I COMMAND [conn8303] command local.oplog.rs command: getMore { getMore: 2277507442850471832, collection: "oplog.rs", batchSize: 13981010, maxTimeMS: 5000, term: 2, lastKnownCommittedOpTime: { ts: Timestamp(1668573449, 2688), t: 2 }, $replData: 1, $oplogQueryData: 1, $readPreference: { mode: "secondaryPreferred" }, $clusterTime: { clusterTime: Timestamp(1668573449, 2844), signature: { hash: BinData(0, 3D6BC62F737C84288EF8DC5062F68D70A314756B), keyId: 7166105568476659716 } }, $db: "local" } originatingCommand: { find: "oplog.rs", filter: { ts: { $gte: Timestamp(1668488972, 7) } }, tailable: true, oplogReplay: true, awaitData: true, maxTimeMS: 60000, batchSize: 13981010, term: 2, readConcern: { afterClusterTime: Timestamp(0, 1) }, $replData: 1, $oplogQueryData: 1, $readPreference: { mode: "secondaryPreferred" }, $clusterTime: { clusterTime: Timestamp(1668488984, 2), signature: { hash: BinData(0, 052BE08BB97364A3B36D0B64AE8387624FD8D06E), keyId: 7166105568476659716 } }, $db: "local" } planSummary: COLLSCAN cursorid:2277507442850471832 keysExamined:0 docsExamined:66 numYields:6 nreturned:66 reslen:25336 locks:{ ReplicationStateTransition: { acquireCount: { w: 7 } }, Global: { acquireCount: { r: 7 } }, Database: { acquireCount: { r: 7 } }, Mutex: { acquireCount: { r: 1 } }, oplog: { acquireCount: { r: 7 } } } storage:{} protocol:op_msg 5553ms
/var/log/mongodb-37952.log:2022-11-16T04:38:30.433+0000 local.oplog.rs 593ms
/var/log/mongodb-37952.log:2022-11-16T04:38:30.432+0000 local.oplog.rs 593ms
/var/log/mongodb-37717.log:2022-11-16T04:39:48.082+0000 local.oplog.rs 590ms
/var/log/mongodb-27960.log:2022-11-16T04:34:41.634+0000 local.oplog.rs 1136ms
/var/log/mongodb-27960.log:2022-11-16T04:34:41.597+0000 local.oplog.rs 2794ms
/var/log/mongodb-27960.log:2022-11-16T04:34:41.592+0000 local.oplog.rs 2780ms
/var/log/mongodb-27960.log:2022-11-16T04:34:39.552+0000 local.oplog.rs 750ms
/var/log/mongodb-27959.log:2022-11-16T04:34:49.841+0000 local.oplog.rs 1700ms
/var/log/mongodb-27959.log:2022-11-16T04:34:47.917+0000 local.oplog.rs 2864ms
/var/log/mongodb-27959.log:2022-11-16T04:34:47.896+0000 local.oplog.rs 834ms
/var/log/mongodb-27959.log:2022-11-16T04:34:47.696+0000 local.oplog.rs 2645ms
/var/log/mongodb-27959.log:2022-11-16T04:34:44.543+0000 local.oplog.rs 731ms
/var/log/mongodb-27959.log:2022-11-16T04:34:44.538+0000 local.oplog.rs 728ms
/var/log/mongodb-27958.log:2022-11-16T04:32:17.638+0000 local.oplog.rs 556ms
/var/log/mongodb-27957.log:2022-11-16T04:38:30.430+0000 local.oplog.rs 590ms
/var/log/mongodb-27954.log:2022-11-16T04:34:41.534+0000 local.oplog.rs 2731ms
/var/log/mongodb-27954.log:2022-11-16T04:34:41.250+0000 local.oplog.rs 2446ms
/var/log/mongodb-27953.log:2022-11-16T04:38:54.832+0000 local.oplog.rs 760ms
/var/log/mongodb-27953.log:2022-11-16T04:38:54.816+0000 local.oplog.rs 744ms
/var/log/mongodb-27953.log:2022-11-16T04:36:43.602+0000 local.oplog.rs 921ms
/var/log/mongodb-27953.log:2022-11-16T04:36:43.598+0000 local.oplog.rs 917ms
/var/log/mongodb-27953.log:2022-11-16T04:36:43.584+0000 local.oplog.rs 903ms
/var/log/mongodb-27953.log:2022-11-16T04:34:49.867+0000 local.oplog.rs 1719ms
/var/log/mongodb-27953.log:2022-11-16T04:34:49.830+0000 local.oplog.rs 1682ms
/var/log/mongodb-27953.log:2022-11-16T04:34:49.830+0000 local.oplog.rs 1270ms
/var/log/mongodb-27952.log:2022-11-16T04:39:11.530+0000 local.oplog.rs 651ms
/var/log/mongodb-27952.log:2022-11-16T04:38:35.177+0000 local.oplog.rs 729ms
/var/log/mongodb-27952.log:2022-11-16T04:37:51.275+0000 local.oplog.rs 1193ms
/var/log/mongodb-27951.log:2022-11-16T04:38:30.438+0000 local.oplog.rs 598ms
/var/log/mongodb-27951.log:2022-11-16T04:37:35.348+0000 local.oplog.rs 5553ms
/var/log/mongodb-27737.log:2022-11-16T04:39:48.089+0000 local.oplog.rs 595ms
/var/log/mongodb-27737.log:2022-11-16T04:39:48.088+0000 local.oplog.rs 594ms
/var/log/mongodb-27737.log:2022-11-16T04:39:48.086+0000 local.oplog.rs 589ms
/var/log/mongodb-27730.log:2022-11-16T04:33:25.480+0000 local.oplog.rs 897ms
/var/log/mongodb-27730.log:2022-11-16T04:33:25.472+0000 local.oplog.rs 888ms ```