[SERVER-1096] Size for capped collection Created: 06/May/10  Updated: 12/Jul/16  Resolved: 24/Sep/10

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: None
Fix Version/s: 1.7.1

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 Description   

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)"
}



 Comments   
Comment by auto [ 24/Sep/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: more obvious db.getReplicationInfo() before an oplog roll-over SERVER-1096
http://github.com/mongodb/mongo/commit/f3b6f4dd8d90e0c9e10548b5b46dc8f9095282b0

Comment by Aaron Staple [ 10/Aug/10 ]

Any thoughts on the timeDiff issue?

Comment by Aaron Staple [ 09/Aug/10 ]

Is timeDiff supposed to represent the time diff for a full oplog? If so, maybe we should rename it (or add a new field with a clearer name).

Comment by auto [ 09/Aug/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-1096 inc ns size when inserting into oplog
http://github.com/mongodb/mongo/commit/d5953b39fce0ab26c2e9d7d8effafab0875f37f3

Generated at Thu Feb 08 02:56:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.