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

Indexes with collations don't work after upgrading from 3.2

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.0-rc0
    • Component/s: Index Maintenance
    • Labels:
      None
    • ALL
    • Hide
      > db.customers.createIndex(
      ...     {last_name: 1},
      ...     {name: "name_index",
      ...      collation: {locale: "de"}
      ...     }
      ... );
      {
      	"ok" : 0,
      	"errmsg" : "Invalid index specification { key: { last_name: 1.0 }, name: \"name_index\", collation: { locale: \"de\" } }; cannot create an index with the 'collation' option and v=1",
      	"code" : 67,
      	"codeName" : "CannotCreateIndex"
      }
      
      > db.customers.createIndex(
      ...     {last_name: 1},
      ...     {name: "name_index",
      ...      collation: {locale: "de"},
      ...      v: 2
      ...     }
      ... );
      {
      	"ok" : 0,
      	"errmsg" : "Invalid index specification { key: { last_name: 1.0 }, name: \"name_index\", collation: { locale: \"de\" }, v: 2.0 }; cannot create an index with v=2 when the featureCompatibilityVersion is 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.",
      	"code" : 67,
      	"codeName" : "CannotCreateIndex"
      }
      
      Show
      > db.customers.createIndex( ... {last_name: 1}, ... {name: "name_index", ... collation: {locale: "de"} ... } ... ); { "ok" : 0, "errmsg" : "Invalid index specification { key: { last_name: 1.0 }, name: \"name_index\", collation: { locale: \"de\" } }; cannot create an index with the 'collation' option and v=1", "code" : 67, "codeName" : "CannotCreateIndex" } > db.customers.createIndex( ... {last_name: 1}, ... {name: "name_index", ... collation: {locale: "de"}, ... v: 2 ... } ... ); { "ok" : 0, "errmsg" : "Invalid index specification { key: { last_name: 1.0 }, name: \"name_index\", collation: { locale: \"de\" }, v: 2.0 }; cannot create an index with v=2 when the featureCompatibilityVersion is 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.", "code" : 67, "codeName" : "CannotCreateIndex" }

      I'm running 3.4 rc0 without cleaning out my old data from previous release(s?).

      When I attempt to add an index with a collation, I get an error that collations aren't supported for v1; if I try to set it to v2 then I get an error that this isn't supported when the featureCompatibilityVersion is 3.2.

      If I start the mongod with an empty data directory then I can create the index.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            andrew.morgan@mongodb.com Andrew Morgan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: