-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Tools and Replicator
-
5
-
1,305
Problem
Mongorestore converts legacy index specs to prevent index creations on the source from erroring. For example, a legacy index (that persisted across upgrades) may have an index key value of 0. 3.4+ server versions no longer allow index key values of 0.
It currently incorrectly converts an index key value less than -1 x 10^9 to 1 (ascending). The server treats these legacy index keys as -1 (descending).
(see mongorestore's risk assessment.)
Solution & Acceptance Criteria
Mongorestore convertLegacyIndexes function should only convert float64s >= 0 to 1.
From the IA:
Support upgrading index specifications from pre-3.4 to 3.4+ server versions correctly. To achieve this we need to do the following for mongosync/mongorestore/mongomirror:
- Check the index version before converting and only convert pre-v2 indexes.
- Fix the known issue in all tools, only convert 0 values of float64 to 1. Mongomirror is importing the bsonutil package from mongo-tools. We will fix it in mongo-tools first and then update the import in mongomirror, and do a new release of the Database Tools (TOOLS-3714) and mongomirror (MGOMIRROR-542). This fix will also be included in mongosync 1.10 release.
Confirm that legacy index key conversion implemented in our tools is correct after the above fix. To achieve this, we will need to reference the internal documentation and restrict legacy index key conversions to only support specific index version upgrades that are documented and tested in
SERVER-96766.
Impact
This bug can cause a legacy index with key less than -1 x 10^9 on the source to be built with key: 1 on the destination. This means that the destination cluster will treat the index as ascending while the source treats it as descending. This can cause unexpected performance issues for users.
- is caused by
-
TOOLS-2710 Non-zero index key values are not preserved in ConvertLegacyIndexes
- Closed
- is depended on by
-
TOOLS-3714 Release Database Tools 100.10.1
- Waiting (Blocked)
- is related to
-
SERVER-96766 Verify behavior of pre-3.4 index key specs on 3.4+ versions
- Closed