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

mongorestore may incorrectly validate index name length before calling createIndexes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 100.0.0
    • Component/s: mongorestore
    • Labels:
      None
    • Case:
    • Backport Requested:
      v4.2

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: