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

DropDatabase does not clear the IndexCache used by EnsureIndex

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.3.1
    • 1.3
    • None
    • None

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: