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

Speed up OpObservers with a filter framework in OpObserverRegistry

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change
    • v7.0
    • Execution Team 2023-06-12

      Today, CRUD Ops are implemented by nearly all of the ~19 OpObservers.
       
      For onUpdate:

      • 4 are too complicated to filter at all and should be called every time
      • 10 could filter on one namespace
      • 1 could filter on two namespaces
      • 1 could filter on three namespaces
      • 1 could filter on four namespaces
      • 1 could filter solely on update.isEmpty

       

      onInserts, aboutToDelete, and onDelete are a similar story with similar amounts of namespace filtering.

       

      By filtering on namespace in the registry, we can eliminate many unnecessary virtual function calls for each CRUD op in the server.

       

      Furthermore, I noticed that all namespace filtering in OpObservers can be fit into three categories:

      • always run (e.g. OpObserverImpl, for logging to oplog and other system-critical functional behavior)
      • observe changes to the internal config database (config.*)
      • observe changes to internal system collections (.system.)

       

            Assignee:
            matt.kneiser@mongodb.com Matt Kneiser
            Reporter:
            matt.kneiser@mongodb.com Matt Kneiser
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: