[SERVER-81187] Disallow introduction of new usages of AutoGetDb/Collection* in the codebase Created: 19/Sep/23  Updated: 11/Jan/24

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: PM-2144-QW-Fallout
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Sprint: Sharding EMEA 2023-10-02
Participants:

 Description   

With the introduction of the Shard Role API under PM-2144 all new code which accesses data from the storage engine must go through one of the acquireCollection variants, which enforce a much stricter contract between the sharding catalog, local catalog and storage engine data.

In order to converge towards the new API we want to disallow the introduction of any new usages of AutoGetDb/Collection and its friends.

This ticket is to move all the variants of the AutoGetDb/Collection API to some internal-sounding namespace (such as collection_internal::) and add a clang-tidy rule to prevent any new usages.



 Comments   
Comment by Kaloian Manassiev [ 11/Oct/23 ]

A prerequisite for this ticket is the implementation of SERVER-81294, which is more work than a simple QW ticket, so I am moving it to the dedicated project PM-3410.

Comment by Kaloian Manassiev [ 20/Sep/23 ]

Proposed execution plan:

  1. Create new files under db/catalog/ called catalog_raii_obsolete.h/.cpp that will continue being linked in the shard_role library.
  2. Move all AutoGetters from catalog_raii and db_raii into the collection_internal::obsolete:: namespace (probably over two separate commits in order to avoid too large of a change all at once).
  3. Delete catalog_raii and db_raii.
  4. Implement a clang-tidy rule to avoid the introduction of new usages of the collection_internal::obsolete:: namespace.
Generated at Thu Feb 08 06:45:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.