Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4715

Check quota before deleting object to move in update

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • ALL

      Start mongod with --quota --quotaFiles 1 --smallfiles

      > db.foo.dropDatabase()
      Wed Jan 18 19:08:42 TypeError: db.foo.dropDatabase is not a function (shell):1
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > x = 'x'
      x
      > while (x.length < 1024*1024) x += x; x.length
      1048576
      > for (var i=0; i< 20; i++ ){ db.foo.save({_id:i, x:x}) }
      quota exceeded
      > db.foo.find({_id:0}, {_id:1})
      { "_id" : 0 }
      > db.foo.count()
      16
      
      All good to this point
      
      > db.foo.save({_id:0, x:x+x}) //boom
      quota exceeded
      > db.foo.find({_id:0}, {_id:1})
      > db.foo.count()
      15
      

      I'll commit a test for this tomorrow.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: