summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@10gen.com>2013-03-12 15:26:21 -0400
committerIan Whalen <ian.whalen@gmail.com>2013-03-13 10:52:08 -0400
commitea0e9f0ae192b23c6855afa18a8868c4dfb3d64c (patch)
tree3403a7508984b5a465ada5df2d6ed11d30ca37cd /jstests/disk
parentf5352a787b042ba663dd5cc9976088f719f5651f (diff)
downloadmongo-ea0e9f0ae192b23c6855afa18a8868c4dfb3d64c.tar.gz
Include filename in warning about smallfiles SERVER-7430
Log message is like "info openExisting file size 16777216 but cmdLine.smallfiles=false: /data/db/filesize/dbname.0" Signed-off-by: Ian Whalen <ian.whalen@gmail.com>
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/filesize.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/jstests/disk/filesize.js b/jstests/disk/filesize.js
new file mode 100644
index 00000000000..ce0df4682c8
--- /dev/null
+++ b/jstests/disk/filesize.js
@@ -0,0 +1,35 @@
+// test for SERVER-7430: Warning about smallfiles should include filename
+
+var port = allocatePorts( 1 )[ 0 ];
+var baseName = "filesize";
+
+// Start mongod with --smallfiles
+var m = startMongod(
+ "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface",
+ "--bind_ip", "127.0.0.1" , "--nojournal" , "--smallfiles" );
+
+var db = m.getDB( baseName );
+db.collection.insert( { x : 1 } );
+
+// Restart mongod without --smallFiles
+stopMongod( port );
+m = startMongodNoReset(
+ "--port", port, "--dbpath", "/data/db/" + baseName,
+ "--nohttpinterface", "--bind_ip", "127.0.0.1" , "--nojournal" );
+
+db = m.getDB( baseName );
+var log = db.adminCommand( { getLog : "global" } ).log
+
+// Find log message like:
+// "openExisting file size 16777216 but cmdLine.smallfiles=false: /data/db/filesize/local.0"
+var found = false, logline = '';
+for ( i=log.length - 1; i>= 0; i-- ) {
+ logline = log[i];
+ if ( logline.indexOf( "openExisting file" ) >= 0
+ && logline.indexOf( baseName + ".0" ) >= 0 ) {
+ found = true;
+ break;
+ }
+}
+
+assert( found );