Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2497

mongorestore may incorrectly validate index name length before calling createIndexes

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 100.0.0
    • Affects Version/s: None
    • Component/s: mongorestore
    • Labels:
      None
    • v4.2

      With MongoDB 4.2 the Index Name Length restriction was removed (SERVER-32959), however when running latest mongorestore while targeting a 4.2.x cluster the following error can still be thrown:

      2020-02-26T03:00:08.839+0000	Failed: xxx.yyy: error creating indexes for xxx.yyy: cannot restore index with namespace 'xxx.yyy.$meta.groupGeocode.coordinates_2dsphere_meta.groupTransactionDate_-1_meta.groupTimestamp_-1': namespace is too long (max size is 127 bytes)
      

      mongorestore should be testing the target cluster's fCV and if it's < 4.2 the string length test can still be applied.

      see https://github.com/mongodb/mongo-tools/blob/31aaebec00b2fa74c9900e07d1e980ce4e6495ee/mongorestore/metadata.go#L166-L170.

            Assignee:
            tim.fogarty@mongodb.com Tim Fogarty
            Reporter:
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Ryan Chipman
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: