-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.0 Required
-
Component/s: Sharding
-
Labels:
-
Sharding EMEA
-
ALL
-
8
In 4.0 when sharding a collection in the config database, we check if the collection is empty, however, this operation is only checking the status of the runCommand call, but it is not checking the response object (something like getEffectiveStatus does), so the following scenario might happen:
1. The config server send the count command to itself, using the runCommand function
2. The primary steps down
3. The command and it's retries fail, storing the result in the commandStatus field
4. After returning the status check succeeds, trying to access an inexistent field
We could add a similar check like it is done when creating the indexes or simply change the code to use getEffectiveStatus.