Currently any changes made to ViewCatalog or system.views collection only mark view catalog as invalid and it will lazily reload when later used. However, lazy reload may read outdated data from system.views and thus load wrong version of view catalog.
To fix this problem, we should always actively reload the view catalog by changing invalidate() function to an active reload function. We also need to set minVisibleSnapshot on the view catalog when reload. Any operations to view catalog will get a writeConflictException if it's behind the minVisibleSnapshot and then retry with a more up-to-date snapshot.
- is duplicated by
-
SERVER-41011 Server may crash when running $where on non-existent collection
- Closed
- is related to
-
SERVER-36816 Avoid reloading the view catalog on the primary and secondaries during the dbhash check
- Closed
- related to
-
SERVER-41011 Server may crash when running $where on non-existent collection
- Closed