[SERVER-63731] Load views in CollectionCatalog initialization rather than Database initialization Created: 16/Feb/22  Updated: 29/Oct/23  Resolved: 11/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: auto-reverted, read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-63663 Rename the DurableViewCatalog to some... Closed
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-09-19, Execution Team 2022-10-03, Execution Team 2022-10-17
Participants:
Linked BF Score: 60

 Description   

DatabaseImpl::init currently loads the views after the CollectionCatalog is available to access the <db>.system.views collections.

Now that we've associated the view catalog with the collection catalog, we should change view loading to when the CollectionCatalog loads.

-------------------------------------------------------------------------------------------------------------

The tricky part of this may be how to identify where to find the views, since the particular <db>.system.views namespaces need to be identified first, and I don't believe we track databases in the CollectionCatalog. So we would likely have to track database names as we load Collections, and then check the databases for existing <db>.system.views collections.

Additionally, the DurableViewCatalog dependency on the Database needs to be removed: right now DurableViewCatalog holds an internal Database*, which is only accessed to get the db name and system.views collection namespace. This should be easily remedied.



 Comments   
Comment by Githook User [ 12/Oct/22 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-63731 Use `NamespaceStringUtil` in `ViewsForDatabase`
Branch: master
https://github.com/mongodb/mongo/commit/315b19c483bd5f32099bbede24d61bebe85fdfc7

Comment by Githook User [ 11/Oct/22 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-63731 Initialize views in `CollectionCatalog`
Branch: master
https://github.com/mongodb/mongo/commit/2b7fe293fef8b8f1bf23cbbc6fcbe51a65daa789

Comment by xgen-buildbaron-user [ 07/Oct/22 ]

Ticket re-opened due to revert. serverless began a consistent failure of jstests/serverless/native_tenant_data_isolation_stop_restart.js

Comment by Githook User [ 07/Oct/22 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com'}

Message: Revert "SERVER-63731 Initialize views in `CollectionCatalog`"

This reverts commit 70792f7734d686ca0c632bc08451ba4b32adca05.
Branch: master
https://github.com/mongodb/mongo/commit/5755c11c400d090bda9e763dd335945b895a0c49

Comment by Githook User [ 07/Oct/22 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-63731 Initialize views in `CollectionCatalog`
Branch: master
https://github.com/mongodb/mongo/commit/70792f7734d686ca0c632bc08451ba4b32adca05

Generated at Thu Feb 08 05:58:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.