summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-10-06 11:04:03 -0400
committerAndy Schwerin <schwerin@10gen.com>2013-10-06 11:04:03 -0400
commit31d759f0fc3ac453b5297df2012fce9c1118ce6f (patch)
treebc89bec91ea8506968b905e7ef894e86f13abc20 /jstests/disk
parent8aaf9fa86aeaeeeede230d8d80a20b22c97745ac (diff)
downloadmongo-31d759f0fc3ac453b5297df2012fce9c1118ce6f.tar.gz
SERVER-11051 Ignore non-existent databases reported by listDatabases in disk/preallocate.js
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/preallocate.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/disk/preallocate.js b/jstests/disk/preallocate.js
index b1d98878ef5..f47c4915ab4 100644
--- a/jstests/disk/preallocate.js
+++ b/jstests/disk/preallocate.js
@@ -9,8 +9,13 @@ var m = startMongod( "--port", port, "--dbpath", "/data/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;
}