-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.1, 3.1.1
-
Component/s: None
-
None
While investigating a spurious test failure in Jenkins I discovered that GridIn uses whatever read preference is set for the root collection. This isn't a problem, generally, when writing grid files. The driver always directs writes to the primary. But, following the GridFS spec, we attempt to create the required indexes for GridFS if they are needed. To determine if the indexes are needed we first do a find_one() on the root collection. If the read preference of the root collection is anything other than PRIMARY we direct that query to a secondary.
GridIn should store an instance of root_collection with read preference set to PRIMARY.