This came out of the work for
SERVER-44260. There are two optimizations we can make here:
1. The bug should only apply to transactions using readConcern: snapshot. We should check this before calling waitForAllEarlierOplogWritesToBeVisible().
2. Ideally, we could pass an optional timestamp parameter into waitForAllEarlierOplogWritesToBeVisible() that specifies the timestamp the all_durable must reach before returning. This would be a weaker guarantee than waiting until the last oplog entry write is durable, but seems like a reasonable extension of this method.
The TransactionParticipant can keep track of the timestamp of the last transaction table write (we only care about prepared commits and prepared aborts), which would be passed into waitForAllEarlierOplogWritesToBeVisible().