[CSHARP-882] In GridFS, Delete, Move and CopyTo should always use ReadPreference.Primary as opposed to user specified ReadPreference Created: 23/Dec/13  Updated: 02/Apr/15  Resolved: 24/Feb/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8.2
Fix Version/s: 1.9

Type: Bug Priority: Minor - P4
Reporter: Craig Wilson Assignee: Sridhar Nanjundeswaran
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

GridFS, in order to ensure read consistency, pins a GridFSFileInfo to the member it was read from. This is inadvertantly used when deleting this file which can cause "Not Primary" errors when the file was read from a secondary.



 Comments   
Comment by Githook User [ 21/Jan/14 ]

Author:

{u'username': u'sridharn', u'name': u'Sridhar Nanjundeswaran', u'email': u'sridhar@10gen.com'}

Message: CSHARP-882 - Fixed Create, CreateText etc which did not work with Secondary read preference
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/df523aeac2230b4077cbf5ff41fb5990c11002e4

Comment by Githook User [ 21/Jan/14 ]

Author:

{u'username': u'sridharn', u'name': u'Sridhar Nanjundeswaran', u'email': u'sridhar@10gen.com'}

Message: CSHARP-882 - Used primary read preference for delete, copyto and moveto
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/04e0ca744f22d938d452c4c33b5e6df93166c939

Comment by Joanna Cheng [ 23/Dec/13 ]

As a workaround, customers can use a ReadPreference of Primary when they know they are going to delete a file. This will, of course, still fail when a primary is unavailable, but should clear up any issues in the meantime until 1.9 is released.

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