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

splitVector command fails on a collection with collation

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.8
    • Component/s: Index Maintenance
    • Labels:
      None
    • ALL
    • 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" } } } ]    

      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.

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

              Created:
              Updated:
              Resolved: