Checks for sharded collections for $out are racy on mongos

XMLWordPrintableJSON

    • Query Optimization
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The checks that we do to enforce certain collections are not sharded on mongos rely on consulting the catalog cache. This is not guaranteed to be up to date and we also don't want to pay for a hard refresh on each query. 

      The observable effects of this are that you can drop a sharded collection transitioning from sharded -> unsharded without every mongos knowing this happened. This means that mongos processes which have not observed this drop will incorrectly reject requests to use it in stages which can't use sharded collections like $lookup and $out.

      If you instead shard ac collection and transition from unshared -> sharded then everything will work fine since the shard versioning protocol will retry the entire command and the second time the mongos will know that the namespace is sharded.

              Assignee:
              Unassigned
              Reporter:
              Charlie Swanson
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: