[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:
Related
related to CDRIVER-3498 GridFS index checking should support ... Closed
is related to CDRIVER-2643 Make the GridFS implementation spec c... Closed

 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.

Generated at Wed Feb 07 21:18:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.