[JAVA-2342] GridFS constructor tries to create index Created: 12/Oct/16  Updated: 12/Oct/16  Resolved: 12/Oct/16

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alessandro Gherardi Assignee: Ross Lawley
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The GridFS class constructor tries to create indexes on the .files and .chunks collection. If the database is read-only - for instance, due to the temporary unavailability of some mongoD's in a replicaset - this causes an attempt to read data to fail.

The indexes should be created when the databases is initialized.



 Comments   
Comment by Ross Lawley [ 12/Oct/16 ]

I'm marking this as "Won't Fix" because the old GridFS implementation was effectively deprecated in 3.0 due to its reliance on the deprecated DB class. As such there are no plans to change the implementation. Especially, as its behaviour has been this way for a number of years.

The good news is in the Java driver 3.1 series we introduced a new GridFS API accessible via com.mongodb.client.gridfs.GridFSBuckets. The new API follows a new GridFS specification. Under this specification reading data from GridFS is accessible to users with read only permissions.

All the best,

Ross

Generated at Thu Feb 08 08:56:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.