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

Possible to accidentally create duplicate indexes which corrupts database

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.4
    • Component/s: Index Maintenance
    • Labels:
      None
    • Environment:
      RHEL 5, CentOS 6.4
    • ALL
    • Hide

      See attached script - basically it create two slightly different indexes with the same name, which hoses the database. Might need to tweak it to add more records if your server is faster than mine.

      Show
      See attached script - basically it create two slightly different indexes with the same name, which hoses the database. Might need to tweak it to add more records if your server is faster than mine.

      My loader scripts call ensureIndex to allow the database to automatically be generated, however it turns out that the current release of the perl API doesn't support the expiresAfterSecond argument, which I discovered after creating the index. Therefore I remove the index and created one in the background from the mongo console. Meanwhile my script restarted, which resulted in the database becoming corrupted (luckily recover did succeed). Have distilled out the underlying issue in an attached script.

        1. mongod.log
          6 kB
        2. mongo-issue.pl
          0.6 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            jimmyjones2 Jimmy Jones
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: