The current plan for Prepare Support for Transactions uses an in-memory data structure to maintain the oldest active transaction timestamp. Instead, we can store the first oplog entry's timestamp of a transaction in the transaction table. Thus the transaction table has all necessary information to calculate the oldest active transaction timestamp. With
SERVER-39679, this calculation may be done only when a checkpoint is taken or an initial sync starts, so its performance isn't a big concern. The updates on the transaction table are timestamped, so calculating the oldest require timestamp is just a read at the checkpoint's timestamp.
If table scan's performance isn't good enough, we can add an index on the "firstTimestamp" field. The index can be a partial index on "firstTimestamp" when a new "active: true" field exists, so that retryable writes and finished transactions don't affect the performance.