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

$explain query against sharded collection with 2.6 shard returns error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.8.0-rc1
    • 2.7.8
    • Diagnostics, Sharding
    • None
    • ALL

    Description

      Running an explain using the $explain query option returns "invalid parameter: expected an object" when run against a sharded collection with a 2.6 shard and 2.7.8 mongos.

      rassi@rassi:~/work/mongo$ ~/mongodb-linux-x86_64-2.6.5/bin/mongod --fork --logpath /dev/null
      about to fork child process, waiting until server is ready for connections.
      forked process: 5847
      child process started successfully, parent exiting
      rassi@rassi:~/work/mongo$ ~/mongodb-linux-x86_64-2.7.8/bin/mongos --configdb=localhost:27017 --port 30000 --fork --logpath /dev/null
      2014-11-10T13:29:28.120-0500 W SHARDING running with 1 config server should be done only for testing purposes and is not recommended for production
      about to fork child process, waiting until server is ready for connections.
      forked process: 5860
      child process started successfully, parent exiting
      rassi@rassi:~/work/mongo$ ~/mongodb-linux-x86_64-2.6.5/bin/mongo --port 30000
      MongoDB shell version: 2.6.5
      connecting to: 127.0.0.1:30000/test
      Server has startup warnings:
      2014-11-10T13:29:28.125-0500 I -
      2014-11-10T13:29:28.125-0500 I -        ** NOTE: This is a development version (2.7.8) of MongoDB.
      2014-11-10T13:29:28.125-0500 I -        **       Not recommended for production.
      2014-11-10T13:29:28.125-0500 I -
      mongos> sh.addShard("localhost:27017")
      { "shardAdded" : "shard0000", "ok" : 1 }
      mongos> sh.enableSharding("test")
      { "ok" : 1 }
      mongos> sh.shardCollection("test.foo", {_id: 1})
      { "collectionsharded" : "test.foo", "ok" : 1 }
      mongos> db.foo.find().explain()
      2014-11-10T13:30:21.666-0500 error: { "$err" : "invalid parameter: expected an object ()", "code" : 10065 } at src/mongo/shell/query.js:131

      Attachments

        Activity

          People

            david.storch@mongodb.com David Storch
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: