Allow a shardsvr tenant migration recipient to create collections directly on itself

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Server Serverless 2021-11-15
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On shardsvr replica sets, the ShardServerOpObserver throws  CannotImplicitlyCreateCollection when creating a new collection unless the OperationShardingState has _allowCollectionCreation set to true.

      (OperationShardingState is a decoration on the OperationContext; see here for more about decorations.)

      This is so that we as developers are aware of all places collection creation can occur, verify they are synchronized with the database critical section, and explicitly enable them using this guard.

      This ticket is to add the guard where the tenant migration recipient creates collections during the bulk clone (similar to the guard where the moveChunk recipient creates collections), so that we can run tenant migrations on shardsvrs.

      This ticket should add a test that a tenant migration succeeds when there is pre-existing data for the tenant on the donor. 

            Assignee:
            Sophia Tan (Inactive)
            Reporter:
            Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: