Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-84301

Replace executeCommandAgainstDatabasePrimary for DDL commands

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL

      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.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: