This ticket added a new server parameter called "rollbackTimeLimitSecs". It represents a time limit, measured in seconds, on the amount of data we are willing to roll back. If the rollback period is too long, we throw an UnrecoverableRollbackError. The duration of that period is calculated using the wall clock times of oplog entries, specifically the difference between the time at the top of the oplog of the rollback node, and that at the common point. This parameter is now freely user-configurable, both on startup and at runtime, the only restriction being that it must be a positive integer.
We limit rollbacks to 30 minutes. Currently we measure the difference in time between the end of the sync source's oplog and the rolling back node's oplog: https://github.com/mongodb/mongo/blob/955dfb45f2f67d2f4570912dbcddecbf3e7bb116/src/mongo/db/repl/roll_back_local_operations.cpp#L97-L108. We should really be measuring the difference between the common point and the end of the rolling back node's oplog.
While we are doing this, we should make the limit configurable.