[CSHARP-353] DropDatabase does not clear the IndexCache used by EnsureIndex Created: 09/Nov/11  Updated: 02/Apr/15  Resolved: 09/Nov/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.3
Fix Version/s: 1.3.1

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

One way to reproduce:

var server = MongoServer.Create("mongodb://localhost/?safe=true");
var database = server["test"];

var text = "Hello World";
var stream = new MemoryStream(Encoding.UTF8.GetBytes(text));

database.Drop();
database.GridFS.Upload(stream, "testfile");
database.Drop();
database.GridFS.Upload(stream, "testfile");

The second upload fails because the index on

{ files_id : 1, n : 1 }

does not exist on the fs.chunks collection. EnsureIndex failed to create it the second time because DropDatabase didn't clear the IndexCache.


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