[SERVER-47123] Remove AutoGetOrCreateDb Created: 25/Mar/20 Updated: 29/Oct/23 Resolved: 30/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Gregory Noma | Assignee: | Benety Goh |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | newgrad | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Execution Team 2021-05-03 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
With the introduction of AutoGetDb::ensureDbExists() and AutoGetCollection::ensureDbExists() in
should be changed into
This change leads to implicitly creating the system.views collection hitting this uassert, which we would should investigate whether we can circumvent. |
| Comments |
| Comment by Benety Goh [ 30/Apr/21 ] |
|
The AutoGetOrCreateDb class has been removed, but there are opportunities for additional code cleanup to be explored in |
| Comment by Githook User [ 30/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: Use AutoGetDb (and its ensureDbExists() method) instead. |
| Comment by Githook User [ 30/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This class is deprecated in favor of AutoGetDb which provides the same functonality |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This class is deprecated in favor of AutoGetDb. |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This still locks the DB in MODE_IX but conveys the intent of the |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This affects repair functionality where we have to save duplicate keys to a local 'lost_and_found' This commit also includes trivial changes to startup logging and the config.system.indexBuilds helper. |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: StorageInterfaceImpl is used in replication to access the storage AutoGetOrCreateDb is deprecated in favor of AutoGetDb and AutoGetCollection. |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This RAII type is deprecated in favor of AutoGetDb and AutoGetCollection. |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 28/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 28/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: AutoGetOrCreateDb is being deprecated in favor or AutoGetDb::ensureDbExists() |
| Comment by Githook User [ 26/Apr/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Benety Goh [ 23/Apr/21 ] |
|
Alternative, we could upgrade the lock mode (using this helper function) for system.views to MODE_X in _createCollection(). |
| Comment by Benety Goh [ 23/Apr/21 ] |
|
The _createCollection() uassert mentioned in the description was introduced in Going by the comment above the assertion, we may be able to tell if the collection lock acquisition is requested by UUID or by namespace from the nsOrUUID argument. For _createCollection(), we can probably convert to a combination of AutoGetDb and CollectionLock for now and defer the work on refining the assertion condition in AutoGetCollection. |