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

Equality query on _id with a sort fails with an InternalError when routed through mongos

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.9
    • Affects Version/s: None
    • Component/s: Querying, Sharding
    • None
    • Fully Compatible
    • ALL
    • QuInt A (10/12/15)

      This is a bug in the new mongos read path, so it only affects the master branch. It does not affect any stable versions.

      The following script reproduces the problem:

      (function() {
          'use strict';
      
          var st = new ShardingTest({shards: 1});
      
          var sdb = st.s.getDB("test");
          var coll = sdb.sortkey_internal_error;
      
          coll.drop();
          assert.writeOK(coll.insert({_id: 1, a: 2}));
      
          assert.eq(1, coll.find({_id: 1}).sort({a: 1}).itcount());
      
          st.stop();
      })();
      

      Looks like a bad interaction between idhack and sortKey meta-projection.

            Assignee:
            yunhe.wang YunHe Wang
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: