-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
Fully Compatible
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The primary can be undefined during topology discovery, e.g. during an election. This will cause the RunQueryStats hook to fail here because we directly use the primary here.
We should check if the primary exists, and if it doesn't we should fall back to using the first node, because this is a similar pattern to what we do in shard_fixture.js: https://github.com/10gen/mongo/blob/d93a8e99d098a24e04a4bf89a2170e80aa49b364/jstests/concurrency/fsm_libs/shard_fixture.js#L63-L68