summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-10-05 20:54:59 -0400
committerAndy Schwerin <schwerin@10gen.com>2013-10-05 20:54:59 -0400
commit8aaf9fa86aeaeeeede230d8d80a20b22c97745ac (patch)
treec835a500b2f3265c981b24064a3fcf3e5cbabc65 /jstests/disk
parent1f5a1ba9f0b73bd1594959bacc03e4fbc1feccaf (diff)
downloadmongo-8aaf9fa86aeaeeeede230d8d80a20b22c97745ac.tar.gz
SERVER-11051 Ignore non-existent databases reported by listDatabases in disk/newcollection.js.
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/newcollection.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/disk/newcollection.js b/jstests/disk/newcollection.js
index f2de651e775..71a17373ae0 100644
--- a/jstests/disk/newcollection.js
+++ b/jstests/disk/newcollection.js
@@ -10,8 +10,13 @@ var t = db[baseName];
var getTotalNonLocalSize = function() {
var totalNonLocalDBSize = 0;
m.getDBs().databases.forEach( function(dbStats) {
- if (dbStats.name != "local")
- totalNonLocalDBSize += dbStats.sizeOnDisk;
+ // We accept the local database's space overhead.
+ if (dbStats.name == "local") return;
+
+ // Databases with "sizeOnDisk=1" and "empty=true" dont' actually take up space o disk.
+ // See SERVER-11051.
+ if (dbStats.sizeOnDisk == 1 && dbStats.empty) return;
+ totalNonLocalDBSize += dbStats.sizeOnDisk;
});
return totalNonLocalDBSize;
}