Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-987

GridFS.findOne needs a variant that takes a ReadPreference

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.0
    • None
    • API, GridFS
    • None

    Description

      For our app we've setup a replica set and chosen to use a secondary-preferred read preference to help distribute requests and recover from node failures. We have the DB configured for secondary preferred and set read preference to primary on a per-request basis - for read and update type operations.

      This fails when dealing with GridFS because their is no ability to provide a read preference in the GridFS API. I started working on a workaround, reading from the bucket.fs collection and passing the preference that way.

      But now the problem is that when reading file chunks, the input stream is reading from the chunks collection with the database default read preference of secondary-preferred. Consequently, I'm going to have to reimplement that in our app to get going. But it sure would be nice if I didn't have to do that.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rwallace@atlassian.com Richard Wallace
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: