Currently, if a shard primary fails over while coordinating a two-phase commit, the new primary will create a new TransactionCoordinator to resume the two-phase commit, and the diagnostics it captures will be as if the new primary had coordinated the entire commit.
The places with TODO comments in transaction_coordinator.cpp should be updated in a way that makes it clear whether the coordinator was resumed after failover or not.