We must not allow transactions on shard servers when the featureCompatibilityVersion is 4.0.
When a replica set is part of a sharded cluster, we can issue transaction commands through multiple routers. This allows us to target primaries in decreasing term order, which can lead to an anomaly where a transaction can go from aborted to committed. This is addressed in FCV 4.2 by performing a write when a transaction is aborted (
SERVER-38132) and aborting a transaction when we return NoSuchTransaction ( SERVER-38133).