Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-353

DropDatabase does not clear the IndexCache used by EnsureIndex

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.1
    • Affects Version/s: 1.3
    • Component/s: None
    • None

      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.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: