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

textIndexVersion compatibility check not complete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.7, 2.5.3
    • Fix Version/s: 2.4.9
    • Component/s: Text Search
    • Labels:
      None
    • Operating System:
      ALL

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rassi J Rassi
              Reporter:
              rassi J Rassi
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: