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

Indexes with collations don't work after upgrading from 3.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.4.0-rc0
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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" }

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: