[DOCS-9013] textIndexVersion compatibility check not complete Created: 28/Sep/16  Updated: 30/Oct/23  Resolved: 24/May/17

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-11494 textIndexVersion compatibility check ... Closed
Participants:
Days since reply: 7 years, 20 weeks ago

 Description   
Issue Status as of December 30th, 2013

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.


Generated at Thu Feb 08 07:57:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.