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

Race in oplog acquisition at startup

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • ALL
    • Repl 2024-03-18

      During ReplicationCoordinatorImpl startup, we initialize the LocalOplogInfo oplog collection by calling acquireOplogForLogging

      https://github.com/mongodb/mongo/blame/b70be78ecfe773a1c9b5685b4af9cd25ea214eb5/src/mongo/db/repl/oplog.cpp#L2548

      This acquires an IX lock on the oplog collection, and oplogInfo itself is not protected at all. Thus a simultaneous call which reads the oplogInfo pointer with only an IS global lock can cause a data race.

      Possibly we should acquire global X here, as the catalog code does when it uses the similar establishOplogForLogging().

            Assignee:
            matthew.russotto@mongodb.com Matthew Russotto
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: