summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-04-06 18:01:55 -0400
committerAndrew Morrow <acm@mongodb.com>2016-04-06 19:03:50 -0400
commit82644cc24c2f7a1817741190052704241cfec669 (patch)
treeb440960c737fba069dc08f9b62b87043af5f92af
parent73290d02e9a89c05762d9500e1be054183bf4db9 (diff)
downloadmongo-82644cc24c2f7a1817741190052704241cfec669.tar.gz
SERVER-23556 Disable mmapv1 on non-x86 platforms
This is a combination of several cherry-picks from master and some branch specific edits (cherry picked from commit cf6f771fb0fe3e8cf8727bdb1d7e7959905a11d0) (cherry picked from commit 060a3c0dcb0f70a2a0a4a74d27efcb1cf24f9fb6) (cherry picked from commit 42930d4ffc88527489f8c60c80a0d57bb95519e5) (cherry picked from commit 558a25b1aa71638f45a54dc83c07fd165ebfe0b9)
-rw-r--r--SConstruct18
-rw-r--r--etc/evergreen.yml84
-rw-r--r--jstests/core/apitest_db.js3
-rw-r--r--jstests/replsets/config_server_checks.js3
-rw-r--r--src/mongo/db/storage/mmap_v1/SConscript167
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_noinit.cpp31
6 files changed, 181 insertions, 125 deletions
diff --git a/SConstruct b/SConstruct
index 71e89000baf..f68d4f65a01 100644
--- a/SConstruct
+++ b/SConstruct
@@ -182,6 +182,14 @@ add_option('ssl',
nargs=0
)
+add_option('mmapv1',
+ choices=['auto', 'on', 'off'],
+ default='auto',
+ help='Enable MMapV1',
+ nargs='?',
+ type='choice',
+)
+
add_option('wiredtiger',
choices=['on', 'off'],
const='on',
@@ -1440,6 +1448,15 @@ if env.TargetOSIs('posix'):
env.Append( LINKFLAGS=["-fstack-protector"] )
env.Append( SHLINKFLAGS=["-fstack-protector"] )
+mmapv1 = False
+if get_option('mmapv1') == 'auto':
+ # The mmapv1 storage engine is only supported on x86
+ # targets. Unless explicitly requested, disable it on all other
+ # platforms.
+ mmapv1 = (env['TARGET_ARCH'] in ['i386', 'x86_64'])
+elif get_option('mmapv1') == 'on':
+ mmapv1 = True
+
wiredtiger = False
if get_option('wiredtiger') == 'on':
# Wiredtiger only supports 64-bit architecture, and will fail to compile on 32-bit
@@ -2540,6 +2557,7 @@ Export("boostSuffix")
Export('module_sconscripts')
Export("debugBuild optBuild")
Export("wiredtiger")
+Export("mmapv1")
def injectMongoIncludePaths(thisEnv):
thisEnv.AppendUnique(CPPPATH=['$BUILD_DIR'])
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 3ea4b6bba7d..1c62268301f 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -4020,7 +4020,7 @@ buildvariants:
tooltags: -gccgoflags "$(pkg-config --libs --cflags libssl libsasl2)" -tags 'sasl ssl'
compile_flags: --ssl MONGO_DISTMOD=rhel71 --release -j$(grep -c processor /proc/cpuinfo) CCFLAGS="-mcpu=power8 -mtune=power8 -mcmodel=medium" CXX=/opt/mongodbtoolchain/v1/bin/g++ CC=/opt/mongodbtoolchain/v1/bin/gcc
num_jobs_available: 20
- test_flags: --continueOnFailure
+ test_flags: --continueOnFailure --excludeWithAnyTags=requires_mmapv1
has_packages: true
packager_script: packager-enterprise.py
packager_arch: ppc64le
@@ -4033,107 +4033,107 @@ buildvariants:
- name: compile
distros:
- rhel71-power8-build
- - name: aggregation
+ # - name: aggregation
- name: aggregation_WT
- name: aggregation_WT_ese
- name: aggregation_auth
- name: aggregation_read_concern_majority_passthrough_WT
- - name: audit
+ # - name: audit
- name: audit_WT
- - name: auth
+ # - name: auth
- name: auth_WT
- - name: auth_audit
+ # - name: auth_audit
- name: auth_audit_WT
- - name: bulk_gle_passthrough
+ # - name: bulk_gle_passthrough
- name: bulk_gle_passthrough_WT
- - name: concurrency
+ # - name: concurrency
- name: concurrency_WT
- - name: concurrency_replication
+ # - name: concurrency_replication
- name: concurrency_replication_WT
- - name: concurrency_sharded
+ # - name: concurrency_sharded
- name: concurrency_sharded_WT
- - name: concurrency_sharded_sccc
+ # - name: concurrency_sharded_sccc
- name: concurrency_sharded_sccc_WT
- - name: concurrency_simultaneous
+ # - name: concurrency_simultaneous
- name: concurrency_simultaneous_WT
- - name: dbtest
+ # - name: dbtest
- name: dbtest_WT
- - name: disk
- - name: dur_jscore_passthrough
- - name: durability
+ # - name: disk
+ # - name: dur_jscore_passthrough
+ # - name: durability
- name: ese_WT
- name: failpoints
- name: failpoints_auth
- - name: gle_auth
+ # - name: gle_auth
- name: gle_auth_WT
- - name: gle_auth_basics_passthrough
+ # - name: gle_auth_basics_passthrough
- name: gle_auth_basics_passthrough_WT
- - name: gle_auth_basics_passthrough_write_cmd
+ # - name: gle_auth_basics_passthrough_write_cmd
- name: gle_auth_basics_passthrough_write_cmd_WT
- - name: gle_auth_write_cmd
+ # - name: gle_auth_write_cmd
- name: gle_auth_write_cmd_WT
- name: httpinterface
- name: integration_tests_replset
- name: integration_tests_standalone
- - name: jsCore
+ # - name: jsCore
- name: jsCore_WT
- name: jsCore_WT_ese
- - name: jsCore_auth
- - name: jsCore_compatibility
+ # - name: jsCore_auth
+ # - name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_minimum_batch_size_WT
- - name: jsCore_op_query
+ # - name: jsCore_minimum_batch_size_WT
+ # - name: jsCore_op_query
- name: jsCore_op_query_WT
- - name: jsCore_small_oplog
+ # - name: jsCore_small_oplog
- name: jsCore_small_oplog_WT
- - name: jsCore_small_oplog_rs
+ # - name: jsCore_small_oplog_rs
- name: jsCore_small_oplog_rs_WT
- - name: mmap
+ # - name: mmap
- name: mongosTest
- - name: noPassthrough
- - name: noPassthroughWithMongod
+ # - name: noPassthrough
+ # - name: noPassthroughWithMongod
- name: noPassthroughWithMongod_WT
- name: noPassthrough_WT
- - name: parallel
+ # - name: parallel
- name: parallel_WT
- - name: parallel_compatibility
+ # - name: parallel_compatibility
- name: parallel_compatibility_WT
- name: read_concern_majority_passthrough_WT
- - name: replicasets
+ # - name: replicasets
- name: replicasets_WT
- name: replicasets_WT_ese
- name: replicasets_auth
- name: replicasets_legacy
- - name: replication
+ # - name: replication
- name: replication_WT
- name: replication_auth
- name: sasl
- - name: sharded_collections_jscore_passthrough
+ # - name: sharded_collections_jscore_passthrough
- name: sharded_collections_jscore_passthrough_WT
- - name: sharding
+ # - name: sharding
- name: sharding_WT
- name: sharding_WT_ese
- name: sharding_auth
- name: sharding_auth_audit_WT
- - name: sharding_gle_auth_basics_passthrough
+ # - name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- - name: sharding_gle_auth_basics_passthrough_write_cmd
+ # - name: sharding_gle_auth_basics_passthrough_write_cmd
- name: sharding_gle_auth_basics_passthrough_write_cmd_WT
- - name: sharding_jscore_passthrough
+ # - name: sharding_jscore_passthrough
- name: sharding_jscore_passthrough_WT
- name: sharding_jscore_passthrough_wire_ops_WT
- name: sharding_legacy
- name: sharding_legacy_op_query_WT
- name: sharding_op_query_WT
- - name: slow1
+ # - name: slow1
- name: slow1_WT
- - name: slow2
+ # - name: slow2
- name: slow2_WT
- - name: snmp
+ # - name: snmp
- name: snmp_WT
- name: ssl
- name: sslSpecial
- - name: tool
+ # - name: tool
- name: tool_WT
- name: unittests
- name: push
diff --git a/jstests/core/apitest_db.js b/jstests/core/apitest_db.js
index 688baa8dd4f..6018835e7f2 100644
--- a/jstests/core/apitest_db.js
+++ b/jstests/core/apitest_db.js
@@ -1,5 +1,8 @@
/**
* Tests for the db object enhancement
+ *
+ * This test requires mmapv1.
+ * @tags: [requires_mmapv1]
*/
assert("test" == db, "wrong database currently not test");
diff --git a/jstests/replsets/config_server_checks.js b/jstests/replsets/config_server_checks.js
index 66d30535677..c88ccf6815b 100644
--- a/jstests/replsets/config_server_checks.js
+++ b/jstests/replsets/config_server_checks.js
@@ -1,6 +1,9 @@
/*
* Tests various combinations of the configsvr field in replica set configurations and the
* command line options that control whether a node can function as a member of a CSRS.
+ *
+ * This test requires mmapv1.
+ * @tags: [requires_mmapv1]
*/
function expectState(rst, state) {
diff --git a/src/mongo/db/storage/mmap_v1/SConscript b/src/mongo/db/storage/mmap_v1/SConscript
index ac5206ea9e5..fe9ee48d491 100644
--- a/src/mongo/db/storage/mmap_v1/SConscript
+++ b/src/mongo/db/storage/mmap_v1/SConscript
@@ -1,4 +1,5 @@
Import("env")
+Import("mmapv1")
env.Library(
target = 'storage_mmapv1',
@@ -25,7 +26,7 @@ env.Library(
"mmap_v1_database_catalog_entry.cpp",
"mmap_v1_engine.cpp",
"mmap_v1_extent_manager.cpp",
- "mmap_v1_init.cpp",
+ "mmap_v1_init.cpp" if mmapv1 else "mmap_v1_noinit.cpp",
"repair_database.cpp",
],
LIBDEPS = [
@@ -148,59 +149,6 @@ env.Library(
]
)
-env.CppUnitTest(
- target='storage_engine_mmap_v1_init_test',
- source=['mmap_v1_init_test.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/db/serveronly',
- '$BUILD_DIR/mongo/util/ntservice_mock',
- ],
- NO_CRUTCH=True,
- )
-
-env.CppUnitTest(target = 'record_access_tracker_test',
- source = ['record_access_tracker_test.cpp'],
- LIBDEPS = ['record_access_tracker',
- '$BUILD_DIR/mongo/util/processinfo',
- '$BUILD_DIR/mongo/util/net/network'])
-
-env.CppUnitTest(target = 'namespace_test',
- source = ['catalog/namespace_test.cpp'],
- LIBDEPS = ['$BUILD_DIR/mongo/util/foundation'])
-
-env.CppUnitTest(
- target='record_store_v1_simple_test',
- source=['record_store_v1_simple_test.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/util/decorable',
- 'record_store_v1_test_help'
- ]
- )
-
-env.CppUnitTest(
- target='record_store_v1_capped_test',
- source=['record_store_v1_capped_test.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/util/decorable',
- 'record_store_v1_test_help'
- ]
- )
-
-
-env.CppUnitTest(
- target='record_store_v1_test',
- source=['mmap_v1_record_store_test.cpp',
- ],
- LIBDEPS=[
- 'record_store_v1_test_help',
- '$BUILD_DIR/mongo/db/storage/record_store_test_harness'
- ]
- )
-
-
env.Library(
target= 'btree',
source= [
@@ -216,35 +164,88 @@ env.Library(
]
)
-env.Library(
- target= 'btree_test_help',
- source= [
- 'btree/btree_test_help.cpp',
- 'heap_record_store_btree.cpp'
- ],
- LIBDEPS= [
- 'btree',
- 'record_store_v1_test_help',
- ]
- )
-
-env.CppUnitTest(
- target='btree_logic_test',
- source=['btree/btree_logic_test.cpp'
+if mmapv1:
+ env.CppUnitTest(
+ target='storage_engine_mmap_v1_init_test',
+ source=['mmap_v1_init_test.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/db/serveronly',
+ '$BUILD_DIR/mongo/util/ntservice_mock',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/util/decorable',
- 'btree_test_help'
- ]
- )
-
-env.CppUnitTest(
- target='btree_interface_test',
- source=['btree/btree_interface_test.cpp'
+ NO_CRUTCH=True,
+ )
+
+ env.CppUnitTest(target = 'record_access_tracker_test',
+ source = ['record_access_tracker_test.cpp'],
+ LIBDEPS = ['record_access_tracker',
+ '$BUILD_DIR/mongo/util/processinfo',
+ '$BUILD_DIR/mongo/util/net/network'])
+
+ env.CppUnitTest(target = 'namespace_test',
+ source = ['catalog/namespace_test.cpp'],
+ LIBDEPS = ['$BUILD_DIR/mongo/util/foundation'])
+
+ env.CppUnitTest(
+ target='record_store_v1_simple_test',
+ source=['record_store_v1_simple_test.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/util/decorable',
+ 'record_store_v1_test_help'
+ ]
+ )
+
+ env.CppUnitTest(
+ target='record_store_v1_capped_test',
+ source=['record_store_v1_capped_test.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/util/decorable',
+ 'record_store_v1_test_help'
+ ]
+ )
+
+
+ env.CppUnitTest(
+ target='record_store_v1_test',
+ source=['mmap_v1_record_store_test.cpp',
+ ],
+ LIBDEPS=[
+ 'record_store_v1_test_help',
+ '$BUILD_DIR/mongo/db/storage/record_store_test_harness'
+ ]
+ )
+
+ env.Library(
+ target= 'btree_test_help',
+ source= [
+ 'btree/btree_test_help.cpp',
+ 'heap_record_store_btree.cpp'
],
- LIBDEPS=[
- 'btree_test_help',
- '$BUILD_DIR/mongo/db/storage/sorted_data_interface_test_harness'
- ]
- )
+ LIBDEPS= [
+ 'btree',
+ 'record_store_v1_test_help',
+ ]
+ )
+
+ env.CppUnitTest(
+ target='btree_logic_test',
+ source=['btree/btree_logic_test.cpp'
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/util/decorable',
+ 'btree_test_help'
+ ]
+ )
+
+ env.CppUnitTest(
+ target='btree_interface_test',
+ source=['btree/btree_interface_test.cpp'
+ ],
+ LIBDEPS=[
+ 'btree_test_help',
+ '$BUILD_DIR/mongo/db/storage/sorted_data_interface_test_harness'
+ ]
+ )
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_noinit.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_noinit.cpp
new file mode 100644
index 00000000000..c6c7737ee88
--- /dev/null
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_noinit.cpp
@@ -0,0 +1,31 @@
+/**
+ * Copyright (C) 2016 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+// Empty file to be used when mmapv1 is not enabled
+//