Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-97358

Make TransactionMetricsObserver "yielding aware" to avoid double counting statistics

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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. 

            Assignee:
            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            Reporter:
            drew.beckmen@mongodb.com Drew Beckmen
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: