Author: Apollon Oikonomopoulos <apoikos@debian.org>
Description: Use MMAPv1 by default on i386
 Since wiredTiger does not build on i386, make sure mongod won't try to use it
 by default.
Last-Update: 2016-12-15
Forwarded: no
--- a/src/mongo/db/storage/storage_options.h
+++ b/src/mongo/db/storage/storage_options.h
@@ -52,7 +52,11 @@
 
     // --storageEngine
     // storage engine for this instance of mongod.
+#if defined(__i386__)
+    std::string engine = "mmapv1";
+#else
     std::string engine = "wiredTiger";
+#endif
 
     // True if --storageEngine was passed on the command line, and false otherwise.
     bool engineSetByUser = false;
--- a/src/mongo/dbtests/framework_options.cpp
+++ b/src/mongo/dbtests/framework_options.cpp
@@ -104,7 +104,11 @@
     options
         ->addOptionChaining(
             "storage.engine", "storageEngine", moe::String, "what storage engine to use")
+#if defined(__i386__)
+        .setDefault(moe::Value(std::string("mmapv1")));
+#else
         .setDefault(moe::Value(std::string("wiredTiger")));
+#endif
 
     options->addOptionChaining("suites", "suites", moe::StringVector, "test suites to run")
         .hidden()
