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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.1.9
    • Querying, Sharding
    • None
    • Fully Compatible
    • ALL
    • QuInt A (10/12/15)

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: