-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Component/s: Collection Management
-
None
-
Needed - No Spec Changes
Summary
Add prose test for listCollections primary-routing rule.
Motivation
The routing MUST clarified by DRIVERS-3481 has no spec test, and existing server selection coverage wouldn't catch the most likely regression, a driver wiring the client's default read preference into listCollections instead of Primary.
Acceptance Criteria
Test 1: listCollections routes to primary in replica set topology
1. Create a command-monitor that captures the ConnectionID of any command with the name listCollections.
2. Create a new client with the command-monitor attached and the read preference set to secondary.
3. Invoke listCollections against the new client and assert that the command succeeded.
4. Verify, via the driver's command-monitoring API, that the operation was issued against the primary node.
Test 2: listCollections succeeds when directly connected to a secondary
1. Construct a client whose URI points at a known secondary and sets directConnection=true.
2. Invoke listCollections and assert that it succeeds.
Go Driver implementation: https://github.com/mongodb/mongo-go-driver/pull/2390
- is caused by
-
DRIVERS-3481 Clarify enumerate-collections Replica Sets section
-
- Implementing
-
- tested by
-
GODRIVER-3912 Clarify enumerate-collections Replica Sets section
-
- Closed
-