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

missing {_id: "hashed"} index after running mongorestore

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongorestore
    • None
    • 31

      Problem Statement/Rationale

      I found that after restoring data through mongodump and mongorestore, there is a probability of losing the {_id: "hashed"} index

      Steps to Reproduce

      1. Create a replica set (mongodb6.0)
      2. Create an index on {_id : "hashed" }
      3. insert some data
      4. run mongodump like:  ./mongodump  --host="xxx" --username="xxx" --password="ixxx" --authenticationDatabase="admin" --authenticationMechanism="SCRAM-SHA-1" --db="xxx" --collection="xxx"
      5. run mongorestore to restore  data to other replicaset : ./mongorestore  --host="xxx" --username="mongouser" --password="xxx" --authenticationDatabase="admin" --authenticationMechanism="SCRAM-SHA-1" 

      Expected Results

       

      Actual Results

      The index on {_id: "hashed"} sometimes may be missing.

      Additional Notes

      I found after jira: https://jira.mongodb.org/browse/TOOLS-3108.

      Previously, the _id index was filtered by index name.

      But now the following method is used.

      So the {_id: "hashed} index may be filtered out incorrectly, depending on its order in the indexes array.

            Assignee:
            felipe.gasper@mongodb.com Felipe Gasper
            Reporter:
            1321280378feng@gmail.com Chao Yin
            Dave Rolsky, Jason Flax
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: