While a background index build is in progress, document updates modifying fields contained in the the index specification may, under specific circumstances, cause mismatched index entries to appear.
This bug may affect background-built index builds only, and only in combination with update operations.
This bug may affect the behavior of queries that use an affected index, which may return incorrect results. Symptoms that indicate a background-built index is affected by this bug include:
- find() queries covered by the index may:
- return documents that don't match the query predicate
- display documents that no longer exist in the collection
- display more than one document with the same _id field
- count() commands may return incorrect counts
- remove() commands may remove documents that don't match the query predicate
Operations that do not use affected indexes are not impacted by this bug.
Note that collection data consistency is unaffected by this bug, only index entries may be affected.
There are no workarounds for this issue. While not all deployments using background-built indexes will be impacted, all users running the affected configurations should upgrade to a version containing the fix and rebuild all background-built indexes to make sure they're not impacted by this bug.
- MongoDB 3.0 with the WiredTiger storage engine
While a background index build is in progress, any document updates modifying fields contained in the the index specification that happen at the same time as the background index build is reading those same documents will result in mismatched index entries. Technical details about this but can be found in
SERVER-22970 and SERVER-23807.
- MongoDB 3.2 with MMAPv1 and WiredTiger storage engines
While a background index build on a set of fields is in progress, any document updates modifying fields contained in the index specification may result in mismatched index entries if the background index build has already processed the documents to be updated, or if such documents are being processed by the index build at the same time. Technical details about this bug can be found in
SERVER-22970, SERVER-23807 and SERVER-23655.
The fix is included in the 3.2.6 production release. A fix for MongoDB 3.0 for users of the WiredTiger engine is included in the 3.0.12 production release.
After upgrading to one of these versions, all background-built indexes need to be rebuilt to avoid this issue.