Add GridFSBucketOptions.SuppressEnsureIndexes

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.4.4
    • Component/s: GridFS
    • Environment:
      All
    • None
    • Fully Compatible
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      The GridFS Driver currently calls EnsureIndexes during UploadFromStream. This is normally highly convenient because it ensures that files/chunks tables are correctly set up, with zero admin setup required. However, there is one highly significant downside (plus one less important downside).

      Downside 1: if you have SHARDED files/chunks collections, then the EnsureIndexes routine will fail when ANY shard is unavailable (even if the write operation pertains to a shard that is perfectly fine). This is because the EnsureIndexes routine issues a "find" operation and that find operation gets broadcast to all shards - so if one shard is down, the find will fail and so the whole write will fail. In my case, users in London are unable to save to London data centre, because New York data centre is currently offline - bad!

      Downside 2: Running EnsureIndexes requires user to have find permission, list (and potentially create) indexes permission. In my use case, I do not want user to have find permission (they can write but cannot read).

              Assignee:
              Adelin Mbida Owona
              Reporter:
              John Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: