ISSUE SUMMARY
If an index build attempt creates a tenth index on a collection (counted by including the default _id index), and such an index build fails (due to a uniqueness constraint violation, for example), the index catalog can become corrupted. This will cause all subsequent inserts to this collection to fail.
USER IMPACT
If an index build in the tenth index slot fails or is interrupted, it will render the index catalog for the collection corrupt. To fix the corruption, repair the database or resync the replica set node from a healthy node.
SOLUTION
Fixing the off-by-one error when trying to remove an index build in progress fixed the issue.
WORKAROUNDS
The most common scenario that triggers the bug is an index build failure due to a uniqueness constraint violation. In this situation, the corruption can be avoided if
- the 10th index is not a unique index, or
- there are no duplicate keys, or
- the dropDups option is specified
PATCHES
The fix is included in the production release 2.4.10. Version 2.6 is unaffected by this issue.