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

Centralise cached oplog pointer initialization to collection registering in catalog

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • 3

      There's several calls to acquireOplogCollectionForLogging and establishOplogCollectionForLogging in different parts of the code, attempting to fetch the oplog Collection pointer and cache it. 

      If the Collection object exists and is available, it must have been registered in the collection catalog. There already is onDeregisterFromCatalog call which basically clears the cached oplog pointer. We could do the same for the register path, and register the created instance. Ending up with a single call to establishOplogCollectionForLogging.

      The drawback is some tests manually creating the oplog collection have to be fixed. (Mainly due to global write lock requirement / invariant). More generally, we'd have to address a user attempting to create local.oplog.rs (but this probably shouldn't be allowed in the first place).

      (Split off from SERVER-80789 to ease backportability)

            Assignee:
            Unassigned Unassigned
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: