Setting the shard role for secondary namespaces should use the proper dbVersion

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • 2
    • None
    • 3
    • TBD
    • 🟩 Routing and Topology
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, the createScopedShardRoles helper in initialize_auto_get_helper.h sets the dbVersion which is already set on the opCtx. In the case that the main namespace is sharded, though, there is no guarantee that any dbVersion has been set there. We should instead use the dbVersion that is present in the routing information, as this will ensure that we set a dbVersion if any of the collections are unsharded.

      We will need to take special care to handle the cases where

      1. Two namespaces are unsharded - the setShardRole helper does not appreciate recursive calls setting the same dbVersion
      2. Two unsharded namespaces have different ideas of the dbVersion - this could happen if one (or both) of the routing informations are stale

              Assignee:
              Unassigned
              Reporter:
              Allison Easton
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: