diff options
author | Sam Rossi <sam.rossi@mongodb.com> | 2016-09-06 16:03:41 -0400 |
---|---|---|
committer | Sam Rossi <sam.rossi@mongodb.com> | 2016-09-09 17:52:43 -0400 |
commit | 8b6e135599eaf369ab89c9952c9ae646f60ceb7e (patch) | |
tree | aae936dede5ac321982efda421da3e1962182e16 | |
parent | 5adc47945eaec50a7bf502fe842473bd7ceae5f6 (diff) | |
download | mongo-8b6e135599eaf369ab89c9952c9ae646f60ceb7e.tar.gz |
SERVER-22606 add warning for using wiredtiger with ext4
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp index 2d4db8a3123..51037057cca 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp @@ -29,6 +29,10 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage +#if defined(__linux__) +#include <sys/vfs.h> +#endif + #include "mongo/platform/basic.h" #include "mongo/base/init.h" @@ -61,6 +65,24 @@ public: warning() << "Recovering data from the last clean checkpoint."; } +#if defined(__linux__) +// This is from <linux/magic.h> but that isn't available on all systems. +// Note that the magic number for ext4 is the same as ext2 and ext3. +#define EXT4_SUPER_MAGIC 0xEF53 + { + struct statfs fs_stats; + int ret = statfs(params.dbpath.c_str(), &fs_stats); + + if (ret == 0 && fs_stats.f_type == EXT4_SUPER_MAGIC) { + log() << startupWarningsLog; + log() << "** WARNING: Using the XFS filesystem is strongly recommended with the " + "WiredTiger storage engine"; + log() << "See " + "http://dochub.mongodb.org/core/prodnotes-filesystem"; + } + } +#endif + size_t cacheMB = WiredTigerUtil::getCacheSizeMB(wiredTigerGlobalOptions.cacheSizeGB); const bool ephemeral = false; WiredTigerKVEngine* kv = |