-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Repl 2024-12-09, Repl 2024-12-23
TransactionMetricsObserver::onTransactionOperation updates numerous metric-tracking objects by accumulating statistics for each operation within the transaction. The code relies on the assumption that onTransactionOperation will only be called once per operation (either commit or abort).
However, we've since introduced yielding, which allows a logical operation to invoke this method more than once because it is also called when stashing a transaction participant. This had the unintended side-effect of double counting metrics for a single logical operation (an example would be a $lookup on a sharded cluster that requires a network call to remote node). We need to fix the double counting on yield issue by ensuring stats are only accumulated once per operation.