[CDRIVER-3503] GridFS index creation should be deferred until first write operation Created: 24/Jan/20 Updated: 07/Oct/21 Resolved: 11/May/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | GridFS |
| Affects Version/s: | 1.16.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Andreas Braun |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
_mongoc_gridfs_new always calls _mongoc_gridfs_ensure_index, which conflicts with the GridFS spec for Indexes. Index should only be created before the first write operation on a bucket, and even then the driver should first check if they already exist. This avoids errors where the user has permissions to insert documents into the GridFS collections but does not have permissions to manage indexes. |
| Comments |
| Comment by Andreas Braun [ 11/May/20 ] |
|
As this only affects the deprecated legacy API, we will not fix this. The mongoc_gridfs_bucket is spec-compliant and thus doesn't have this problem. |