It is possible for the splitVector command to return split points that are outside the min/max range that it was told to search, when there is data corruption. This can cause downstream problems for splitChunk (see SERVER-25602).
To keep potential problems in splitVector contained, it could have one or both of the following sanity checks:
- Have a postcondition that all the split points being returned lie between min (inclusive) and max (exclusive).
- Somewhat equivalently, have a loop invariant that the currKey variable always lies between min and max.
(However, it may be more appropriate to fail the splitVector command, rather than to completely abort the mongod with an fassert/invariant failure.)
- related to
-
SERVER-25602 splitChunk command with out of bound splitKeys fails, but still updates the chunks
- Closed
-
SERVER-27082 validate() can't catch certain corruptions within index structure on MMAPv1
- Closed