Mongorestore wrongly attempts to create 2dsphere indexes as v1 on timeseries collections

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 18

      Problem Statement/Rationale

      Due to SERVER-77374, mongodump might dump an unversioned 2dsphereIndex on a time-series collection. Mongorestore treats unversioned 2dsphereIndexes as legacy indexes and thus always attempts to create them as v1. Attempting to restore a v1 2dshpereIndex causes mongorestore to fail with an error like the one below:

      Failed: test.timeseries_geonear_measurements_indexed: error creating indexes for test.timeseries_geonear_measurements_indexed: createIndex error: (CannotCreateIndex) Error in specification { name: "loc_2dsphere", 2dsphereIndexVersion: 1, key: { data.loc: "2dsphere_bucket" }, originalSpec: { key: { loc: "2dsphere" }, name: "loc_2dsphere", 2dsphereIndexVersion: 1, v: 2 }, v: 2 } :: caused by :: unsupported geo index version { 2dsphereIndexVersion : 2dsphereIndexVersion: 1 }, only versions: [3] are supported
      

      Steps to Reproduce

      1. Create a time-series collection with 2dsphereIndex
      2. Use mongodump to dump the collection
      3. Run mongorestore to restore the collection with the 2dsphereIndex

      Expected Results

      Index restored with correct version.

      Actual Results

      Mongorestore failure.

      Additional Notes

      Discovered in passthrough test (link).

            Assignee:
            Unassigned
            Reporter:
            Jian Guan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: