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

splitVector command fails on a collection with collation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: 3.6.8
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

       

      mongos> use chetan
      switched to db chetan
      mongos> db.createCollection("contacts", {collation: {locale: "fr"}})
      { "ok" : 1 }
      mongos> db.contacts.insert({category : 1})
      WriteResult({ "nInserted" : 1 })
      mongos> db.contacts.insert({category : 2})
      WriteResult({ "nInserted" : 1 })
      mongos> db.contacts.insert({category : 3})
      WriteResult({ "nInserted" : 1 })
      mongos> db.contacts.insert({category : 4})
      WriteResult({ "nInserted" : 1 })
      mongos> db.contacts.insert({category : 5})
      WriteResult({ "nInserted" : 1 })
      mongos> db.runCommand({splitVector : "chetan.contacts", keyPattern : { "_id" : 1}, maxChunkSize : 256})
      {
       "ok" : 0,
       "errmsg" : "couldn't find index over splitting key { _id: 1.0 }",
       "code" : 27,
       "codeName" : "IndexNotFound"
      }
      mongos>
      

      mongos> db.getCollectionInfos()
      [
       {
       "name" : "contacts",
       "type" : "collection",
       "options" : {
       "collation" : {
       "locale" : "fr",
       "caseLevel" : false,
       "caseFirst" : "off",
       "strength" : 3,
       "numericOrdering" : false,
       "alternate" : "non-ignorable",
       "maxVariable" : "punct",
       "normalization" : false,
       "backwards" : false,
       "version" : "57.1"
       }
       },
       "info" : {
       "readOnly" : false
       },
       "idIndex" : {
       "v" : 2,
       "key" : {
       "_id" : 1
       },
       "name" : "_id_",
       "ns" : "chetan.contacts",
       "collation" : {
       "locale" : "fr",
       "caseLevel" : false,
       "caseFirst" : "off",
       "strength" : 3,
       "numericOrdering" : false,
       "alternate" : "non-ignorable",
       "maxVariable" : "punct",
       "normalization" : false,
       "backwards" : false,
       "version" : "57.1"
       }
       }
       }
      ]
       

       

      Show
        mongos> use chetan switched to db chetan mongos> db.createCollection("contacts", {collation: {locale: "fr"}}) { "ok" : 1 } mongos> db.contacts.insert({category : 1}) WriteResult({ "nInserted" : 1 }) mongos> db.contacts.insert({category : 2}) WriteResult({ "nInserted" : 1 }) mongos> db.contacts.insert({category : 3}) WriteResult({ "nInserted" : 1 }) mongos> db.contacts.insert({category : 4}) WriteResult({ "nInserted" : 1 }) mongos> db.contacts.insert({category : 5}) WriteResult({ "nInserted" : 1 }) mongos> db.runCommand({splitVector : "chetan.contacts", keyPattern : { "_id" : 1}, maxChunkSize : 256}) { "ok" : 0, "errmsg" : "couldn't find index over splitting key { _id: 1.0 }", "code" : 27, "codeName" : "IndexNotFound" } mongos> mongos> db.getCollectionInfos() [ { "name" : "contacts", "type" : "collection", "options" : { "collation" : { "locale" : "fr", "caseLevel" : false, "caseFirst" : "off", "strength" : 3, "numericOrdering" : false, "alternate" : "non-ignorable", "maxVariable" : "punct", "normalization" : false, "backwards" : false, "version" : "57.1" } }, "info" : { "readOnly" : false }, "idIndex" : { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "chetan.contacts", "collation" : { "locale" : "fr", "caseLevel" : false, "caseFirst" : "off", "strength" : 3, "numericOrdering" : false, "alternate" : "non-ignorable", "maxVariable" : "punct", "normalization" : false, "backwards" : false, "version" : "57.1" } } } ]    

      Description

      I created a collection with collation specified.

      Wrote 5 documents in the collection.

      Ran splitVector command. But, hit an error that "couldn't find index over splitting key { _id: 1.0 }"

      Commands performed in Mongodb shell are written in "Steps to Reproduce" section.

      Any help in alternative solution to splitVector is appreciated.

        Attachments

          Activity

            People

            Assignee:
            kelsey.schubert Kelsey T Schubert
            Reporter:
            cpaithane Chetan Paithane
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: