Clean up stale log entries when the transaction manager starts
Currently, the transaction manager keeps log entries that are still referred to by other transactions. Those log entries are used for verifying and checking conflicts of a long-running operation such as packing refs or repacking, to name a few. As a result, those entries might not be deleted from the database immediately after it's applied if it's still referred. Instead, it's removed when such transactions finish, either committed or rolled back.
When the transaction manager stops, a race between the transaction and the manager might occur so that the transaction is aborted after the manager already stopped. In such cases, the database could not be accessed anymore and the log entry could not be deleted. While this is not a data consistency issue, some log entries are left behind and never cleaned up. Although the race is quite rare, the transaction manager should get rid of any log entries having LSN <= Applied LSN at start-up.