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

Size for capped collection

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.1
    • Affects Version/s: None
    • Component/s: Usability
    • Labels:
      None

      Right now the size field of db.oplog.$main.stats() is always 0. This makes it impossible to tell how much data is there before it wraps, so you can't know if its large enough.
      > db.oplog.$main.stats()
      {
      "ns" : "local.oplog.$main",
      "count" : 37,
      "size" : 0,
      "storageSize" : 990000128,
      "numExtents" : 1,
      "nindexes" : 0,
      "lastExtentSize" : 990000128,
      "paddingFactor" : 1,
      "flags" : 0,
      "totalIndexSize" : 0,
      "indexSizes" : {

      },
      "capped" : 1,
      "max" : 2147483647,
      "ok" : 1
      }

      Also, the timeDiff and timeDiffHours fields of db.getReplicationInfo() should probably use (time * (storageSize / size)) to have more accurate results early on. Example of the issue:
      > db.getReplicationInfo()
      {
      "logSizeMB" : 990,
      "timeDiff" : 224,
      "timeDiffHours" : 0.06,
      "tFirst" : "Thu May 06 2010 10:14:17 GMT-0400 (EDT)",
      "tLast" : "Thu May 06 2010 10:18:01 GMT-0400 (EDT)",
      "now" : "Thu May 06 2010 10:18:11 GMT-0400 (EDT)"
      }

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

              Created:
              Updated:
              Resolved: