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

Checks for sharded collections are racy on mongos

    • Query Optimization
    • ALL

      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:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: