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)
- depends on
-
SERVER-34145 Persist DB version on primary
- Closed