[SERVER-34146] OpObserver should cause secondary to invalidate in-memory cache entry for db Created: 27/Mar/18  Updated: 29/Oct/23  Resolved: 11/Apr/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-34145 Persist DB version on primary Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-04-09, Sharding 2018-04-23
Participants:
Linked BF Score: 0

 Description   

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)



 Comments   
Comment by Githook User [ 11/Apr/18 ]

Author:

{'email': 'golden.janna@gmail.com', 'name': 'jannaerin', 'username': 'jannaerin'}

Message: SERVER-34146 Remove deleted test from blacklist
Branch: master
https://github.com/mongodb/mongo/commit/48bafb9e1c0c5213310f498712f930b836a6ee19

Comment by Githook User [ 11/Apr/18 ]

Author:

{'email': 'golden.janna@gmail.com', 'name': 'jannaerin', 'username': 'jannaerin'}

Message: SERVER-34146 OpObserver should cause secondaries to invalidate their in-memory cache entry for a db
Branch: master
https://github.com/mongodb/mongo/commit/b9354980a1f3d215640e67afcf780f10612694d5

Generated at Thu Feb 08 04:35:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.