We use SideTransactionBlock to do things outside a transaction, while in a multi-document transaction. E.g., when OpObserverImpl writes the prepare oplog entry or (in
SERVER-36494) when TransactionParticipant writes to another collection in the "local" DB.
It seems error-prone that a side transaction block only partly masks the state of the outer transaction. For example, state methods like TransactionParticipant::inMultiDocumentTransaction() reflect the outer transaction.
This can cause mistakes when recursing into the TransactionParticipant while doing an operation in a side transaction via
Audit uses of SideTransactionBlock and consider extending the SideTransactionBlock to more thoroughly mask evidence of the TransactionParticipant's outer transaction.