[SERVER-84301] Replace executeCommandAgainstDatabasePrimary for ddl commands Created: 19/Dec/23  Updated: 21/Dec/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Enrico Golfieri Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-83399 [FLE] Cleanup performed over an unsha... Closed
Assigned Teams:
Catalog and Routing
Operating System: ALL
Participants:

 Description   

executeCommandAgainstDatabasePrimary is mainly used from cluster commands to execute ddl command against the primary such as here. However, the helper functions always attaches the ShardVersion::UNSHARDED. This is actually not needed. Once a shard enters in the Shard Role, it will validate the routing information and throw in case the nss is sharded, such as here

The UNSHARDED version should only be used when targetting specifically untracked unsharded collection. 

After SERVER-83399 a new helper called 

executeDDLCommandAgainstDatabasePrimary

 was introduced to only attach dbVersion

 

The goal of this ticket is to:

  • Replace executeCommandAgainstDatabasePrimary with executeDDLCommandAgainstDatabasePrimary for coordinators command
  • Evaluate whether to remove executeCommandAgainstDatabasePrimary if no longer needed. In case still needed, we could rename it to specifically express the intent of targetting untracked unsharded collection, and not just the primary.

Generated at Thu Feb 08 06:54:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.