When using a hashed shard key, the hashes are all NumberLong values. However, the split command allows splitting at values that are not NumberLongs. Such split attempts are non-sensical and should be rejected.
One particular case is splitting at a double-precision value. Since doubles and NumberLongs are sorted according to the actual numeric value, this leads to chunks with double precision min/max (or mixed double/NumberLong), rather than exclusively NumberLongs. The problem gradually worsens as chunks are auto-split, until eventually SERVER-14759 is hit.
However, this is still a problem in its own right, because not all NumberLongs can be represented as doubles (which is of course why NumberLongs are used in the first place). Thus, even in the absence of SERVER-14759 this is still a problem, because it prevents chunks in a hashed shard key from being split as finely as they ought to be. This may lead to uneven load between shards, which is against the design goals of hashed shard keys.
It is true that auto-splits are always correctly calculated as NumberLongs, but there are some situations where manual splits are required. In this case, SERVER-14217 means that it is easy to accidentally split at double precision values instead of NumberLongs.
- related to
-
SERVER-9931 hashed shard keys do not appear to handle decimal values
- Closed
-
SERVER-14759 Splitting very close to an existing double precision value causes missing chunks
- Closed