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

ServerTransactionsMetrics should synchronize access to non-atomic members

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.1.6
    • None
    • Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2018-12-03
    • 73

    Description

      The ServerTransactionsMetrics class is a service context decoration that maintains server-wide stats for transactions, including the opTimes of uncommitted/aborted transactions. The sets of opTimes are modified by TransactionParticipant through the TransactionMetricsObserver in several places (e.g. onPrepare) and by the ReplicationCoordinator when getting the stable timestamp. There is no internal synchronization for the lists of opTimes, so they can be concurrently modified, leading to data races.

      A simple fix would be to add a mutex to ServerTransactionsMetrics that protects these variables. The other member variables in the class are atomics, so they are already thread-safe.

      Attachments

        Activity

          People

            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: