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

Reuse a single OperationContext in JournalFlusher

    • Storage Execution
    • Fully Compatible
    • Execution Team 2023-11-27
    • 162

      Right now the JournalFlusher thread [destroys and recreates](https://github.com/mongodb/mongo/blob/1501ee35cbe0fba60ecf1d77faa15bc6021a5551/src/mongo/db/storage/control/journal_flusher.cpp#L132-L134) its OperationContext on each iteration of the loop. This isn't a cheap operation, and it isn't necessary. We should instead remove that code and make sure that we release the snapshot prior to sleeping in each iteration. We will also need to be careful not to reuse the OpCtx after it is interrupted.

      This isn't the biggest bottleneck in the j:1 latency, but because there is only one thread doing the loop, and this currently happens after we are notified that someone is waiting for journaling, it does contibute to j:1 latency. And its relative impact will grow as we address other bottlenecks.

            Assignee:
            chenhao.qu@mongodb.com Chenhao Qu
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: