|
Before the batch oplog application was implemented, the secondary would record the oplog right away after applying one oplog operation. After the implementation was introduced in 2.2, mongod now records the oplog documents from the batch right after it finishes processing the entire batch. I believe this is done to preserve the same oplog ordering from the sync source. However, this widens the gap between the time that the operation has actually been applied on the secondary and the time the oplog entry is recorded in the secondary. The repl lag is currently calculated based on the timestamp difference between the latest oplog document, so it can display a lag value greater than the actual progress made by the secondary.
|