Question
Why does the connector setup test fail and report I don't have 24 hours worth of oplogs?
Environment
Connector: MongoDB
Answer
There is no variable to control the "length" of time in Mongo versions below 4.4; only the size. You must extrapolate the length of time based on the size.
Mongo docs to change the oplog size
The connector setup tests run these two commands to determine if 24 hours of oplog are available:
db.oplog.rs.find().sort({$natural: -1}).limit(1);
db.oplog.rs.find().sort({$natural: 1}).limit(1);
We compare the two timestamps to determine if 24 hours worth of logs are available.
New in version 4.4: MongoDB 4.4 supports specifying a minimum oplog retention period in hours, where MongoDB only removes an oplog entry if:
- The oplog has reached the maximum configured size, and
- The oplog entry is older than the configured number of hours.
Cause
The oldest and newest oplog entry is not 24 hours different.
Comments
0 comments
Please sign in to leave a comment.