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

dataSize command parses namespace incorrectly when sharded

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.7
    • 3.1.2
    • Internal Code, Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 8 08/28/15

    Description

      On mongod the dateSize command takes as its first argument the fully qualified namespace. To do this it overrides the parseNs method to use parseNsFullyQualified: https://github.com/mongodb/mongo/blob/master/src/mongo/db/dbcommands.cpp#L680.

      Mongos does not do that, so it expects its first argument to be just the collection name part, not including the database name as the mongod side expects.

      This makes this command effectively broken and unusable through mongos:

      > use test
      switched to db test
      > db.runCommand({dataSize:'test.foo'})
      {
      	"code": 13408,
      	"ok": 0,
      	"errmsg": "exception: keyPattern must equal shard key"
      }
      > db.runCommand({dataSize:'foo'})
      {
      	"errmsg": "exception: need a non-empty collection name",
      	"code": 28538,
      	"ok": 0,
      	"$gleStats": {
      		"lastOpTime": Timestamp(0, 0),
      		"electionId": ObjectId("55b904a69035d5fa8adaf55e")
      	}
      }
      

      Attachments

        Activity

          People

            spencer@mongodb.com Spencer Brody (Inactive)
            james.cohan James Cohan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: