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

Duplicated code in ShardingCatalogManager to serve the commit of addShard and createDatabase requests

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

      The commit phase of enableSharding is currently implemented by ShardingCatalogManager::createDatabase() and includes logic to:

      • perform initial checks on the received parameters
      • validate that the incoming request does not conflict with already persisted namespaces
      • perform the needed insertions into the sharding catalog

      Some very similar logic is also implemented within ShardingCatalogManager::addShard() to import the set of databases stored in the shard being added.

      A common function could be extracted to remove duplicated code.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            paolo.polato@mongodb.com Paolo Polato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: