Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1019

GridIn must use readPreference PRIMARY

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2
    • Affects Version/s: 3.1, 3.1.1
    • Component/s: None
    • Labels:
      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.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: