[SERVER-45975] Add --oplogMinRetentionHours argument and use it to limit oplog truncation Created: 04/Feb/20  Updated: 29/Oct/23  Resolved: 19/Feb/20

Status: Closed
Project: Core Server
Component/s: Replication, Storage
Affects Version/s: None
Fix Version/s: 4.3.4

Type: Improvement Priority: Major - P3
Reporter: Geert Bosch Assignee: Andrew Chen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-41381 Expire oplog entries by time instead ... Closed
is duplicated by SERVER-45976 Add a new replication.oplogMinRetenti... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-02-10, Execution Team 2020-02-24
Participants:
Linked BF Score: 0

 Description   

Allow specifying a minimum retention time for the oplog in addition to a maximum size. Oplog entries are only deleted if they both exceed the size cap and the minimum retention time.

The retention time is specified in hours, allowing fractions. The default is 0 hours (feature is off).

Use the ReplicationCoordinator::getLastAppliedOpTime() as proxy for "now" and the timestamp derived from Stone::lastRecord as the most recent timestamp in the next oplog range to truncate.



 Comments   
Comment by Githook User [ 18/Feb/20 ]

Author:

{'name': 'Andrew Chen', 'email': 'andrew.chen@10gen.com'}

Message: SERVER-45975: Added --oplogMinRetention cli option

create mode 100644 jstests/noPassthrough/oplog_retention_hours.js
Branch: master
https://github.com/mongodb/mongo/commit/1df4904eb4b094c78935f46a5c6a1ee4ee085d46

Comment by Githook User [ 15/Feb/20 ]

Author:

{'username': 'benety', 'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: Revert "SERVER-45975: Added --oplogMinRetention cli option"

This reverts commit 0f54376c08d368ffcc80f65a0a4271cc0e6e865a.

delete mode 100644 jstests/noPassthrough/oplog_retention_hours.js
Branch: master
https://github.com/mongodb/mongo/commit/44a107ad428459cad6260490ae98bca442e07385

Comment by Githook User [ 14/Feb/20 ]

Author:

{'name': 'Andrew Chen', 'email': 'andrew.chen@10gen.com'}

Message: SERVER-45975: Added --oplogMinRetention cli option

create mode 100644 jstests/noPassthrough/oplog_retention_hours.js
Branch: master
https://github.com/mongodb/mongo/commit/0f54376c08d368ffcc80f65a0a4271cc0e6e865a

Comment by Andrew Chen [ 11/Feb/20 ]

It seems like it is, but for now, it's simpler to use regular time stamps. There was a discussion over the scope doc.

Comment by Judah Schvimer [ 05/Feb/20 ]

Is it possible to use the wall clock time on the oplog entries, or is that not available with the oplog stones?

Generated at Thu Feb 08 05:10:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.