-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.7, 2.5.3
-
Component/s: Text Search
-
None
-
ALL
ISSUE SUMMARY
Text indexes created with ensureIndex in mongod 2.6 are created with a new index format that is incompatible with mongod 2.4. mongod 2.4.8 and earlier do not recognize the fact that the index format is incompatible, such that if the contents of the collection are changed the text index may be left in an invalid state.
USER IMPACT
After downgrading to mongod 2.4.8 or earlier and changing the collection contents, the "text" command may return incorrect results. In addition, if at a later point mongod 2.6 is used with this collection, the $text query operator may match incorrect documents.
SOLUTION
mongod v2.4.9 will correctly forbid changes to collections that have a text index which is incompatible with 2.4. Attempts to insert, update, or remove documents in these collections will return the error message "attempt to use unsupported textIndexVersion 2, only textIndexVersion 1 supported".
WORKAROUNDS
None.
PATCHES
Production release v2.4.9 contains the fix for this issue. When downgrading mongod 2.6 => 2.4, always downgrade to mongod 2.4.9 or later to avoid this issue.
Original Description
The textIndexVersion compatibility check (in both master and the 2.4 branch) is only run during index builds (FTSSpec::fixSpec()). It needs to also be run at time of query/command execution (FTSSpec ctor).
A consequence of the above fact is that already-released versions of 2.4 treat textIndexVersion:2 indexes as textIndexVersion:1. It will thus be undefined behavior to downgrade a database with a textIndexVersion:2 text index (i.e. one created with 2.6) to 2.4.8 or earlier.
- is related to
-
SERVER-12914 mongod 2.4 should not start if unknown indexes present
- Closed
- related to
-
SERVER-10906 Support for legacy text index format textIndexVersion:1
- Closed