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

OpObserver should cause secondary to invalidate in-memory cache entry for db

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2018-04-09, Sharding 2018-04-23
    • 0

      In order for a secondary to invalidate its in-memory cache entry for a database, we need to add OpObservers to watch for a db refresh.

      This is the chain of events we expect to happen:
      1) entering movePrimary critical section increments 'enterCriticalSectionSignal' field in the document in config.cache.databases
      2) secondary replicates the update, OpObserver causes it to clear its in-memory cached database entry
      3) the next request with databaseVersion that comes into the secondary will make the secondary try to refresh because its in-memory cached entry is empty
      4) the secondary's refresh will
      a) call forceDatabaseCacheUpdates on the primary, which blocks behind the critical section and then forces the primary to do a remote refresh
      b) wait for replication of the writes from the refresh
      c) read the updated database entry from disk (now that it has replicated)

            Assignee:
            janna.golden@mongodb.com Janna Golden
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: