-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
Execution Team 2024-12-09
Background
The server only applies stricter index key pattern validation to v:2 indexes (as of SERVER-26659). This means that the server does not apply stricter validation on pre-3.4 legacy indexes. Pre-3.4 index key values could be 0, empty string, numbers other than -1 and 1, non-numeric / string values, etc. See SERVER-11064 for more information. 3.4+ server versions still handle pre-3.4 legacy indexes because these legacy indexes can persist across server upgrades.
Solution
We should confirm how pre-3.4 index key values behave on 3.4+ server versions. This includes (but is not limited to):
- 0
- empty string
- non-numeric / non string values
- really small ints / floats
Any index key value that was accepted in pre-3.4 but not in 3.4+ should be investigated. We should also document this (internally or publicly).
Impact on Mongosync / Mongomirror / Mongorestore
Mongosyc and Mongomirror automatically convert source legacy index specs when building them on the destination. Mongorestore also does this if --convertLegacyIndexes option is enabled. Verifying pre-3.4 index behavior will ensure that mongosync/mongomirror/mongorestore converts them in the right way. For example, mongosync/mongomirror/mongorestore must convert a legacy index key value of 0 to 1 instead -1. Otherwise, the destination cluster will treat the index differently compared to the source cluster, which is a correctness issue for mongosync/mongomirror/mongorestore.
- related to
-
TOOLS-3708 Mongorestore incorrectly converts small negative float64 index keys to 1 instead of -1
- Waiting (Blocked)
-
SERVER-95283 Create test(s) that injects old catalog metadata that is no longer valid
- Open