-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
ALL
-
v4.4, v4.2, v4.0, v3.6
-
Sharding 2021-09-20, Sharding 2021-10-04, Sharding 2021-10-18
-
85
The balancer assumes that the sessions collection is always sharded by _id. So the split points it uses are always computed based on _id.id. So if a the sessions collection is dropped, and re-sharded with a shard key other than _id, the balancer will end up creating invalid chunks (the _configsvrCommitChunkSplit command does not verify that the requested split points have the expected shard key pattern). This issue exists in 3.6, 4.0, 4.2 and 4.4 since prior to SERVER-35804 users are not banned from dropping collections in the config database.
We can solve this by doing one of the following:
- Backport
SERVER-35804. - Make getSplitCandidatesForSessionsCollection() not return any candidate chunks or throw an error if the shard key for config.system.sessions collection is not _id.
- Make the _configCommitChunkSplit command validate that the split points have the expected key pattern (currently, it only verifies that the split points came in increasing order and that are not repeated).