Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-3003

GridFS spec does not allow writing to any shard when the primary shard is down

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: GridFS
    • None
    • Needed

      Summary

      The GridFS spec does not allow writing to any shard when the primary shard is down as reported here:
      https://www.mongodb.com/community/forums/t/issue-with-gridfs-inserts-when-one-of-hte-shard-is-read-only/300340/2

      The problem is that the spec requires the driver to "determine if the files collection is empty using the *primary read preference mode*": https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md#before-write-operations

      Instead the spec should use the read preference inherited from the GridFSBucket database. We could also just use primaryPreferred instead of primary.

      Motivation

      Who is the affected end user?

      Users of GridFS + sharding + non-primary read preference.

      How does this affect the end user?

      When the primary shard goes down, the applications should still be able to write GridFS data to other shards.

      How likely is it that this problem or use case will occur?

      Edge case.

      If the problem does occur, what are the consequences and how severe are they?

      It widens an outage.

      Is this issue urgent?

      Seems high priority.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No.

      Acceptance Criteria

      Allow non-primary read preferences when writing data to GridFS.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: