summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2017-04-19 14:06:11 -0400
committerJonathan Reams <jbreams@mongodb.com>2017-05-04 17:11:11 -0400
commitf11a3f0b70aa19b434629d99eee34c8a3dcd38d2 (patch)
tree3671e6d8862d7fb7eed61d22d3625f1ce040560e
parentc969470f2bdffa66bca8cf8344382a51ec6f3bc4 (diff)
downloadmongo-f11a3f0b70aa19b434629d99eee34c8a3dcd38d2.tar.gz
SERVER-28864 Turn on intra-cluster compression by default
-rw-r--r--buildscripts/resmokeconfig/suites/core_compression.yml25
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_compression.yml17
-rw-r--r--buildscripts/resmokeconfig/suites/sharding_compression.yml14
-rw-r--r--etc/evergreen.yml59
-rw-r--r--jstests/noPassthrough/compression_options.js44
-rw-r--r--src/mongo/transport/message_compressor_registry.cpp11
6 files changed, 53 insertions, 117 deletions
diff --git a/buildscripts/resmokeconfig/suites/core_compression.yml b/buildscripts/resmokeconfig/suites/core_compression.yml
deleted file mode 100644
index d09716735da..00000000000
--- a/buildscripts/resmokeconfig/suites/core_compression.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-selector:
- js_test:
- roots:
- - jstests/core/**/*.js
-
-executor:
- js_test:
- config:
- shell_options:
- global_vars:
- TestData:
- networkMessageCompressors: snappy
- readMode: commands
- networkMessageCompressors: snappy
- hooks:
- - class: ValidateCollections
- - class: CleanEveryN
- n: 20
- fixture:
- class: MongoDFixture
- mongod_options:
- networkMessageCompressors: snappy
- set_parameters:
- enableTestCommands: 1
-
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_compression.yml b/buildscripts/resmokeconfig/suites/replica_sets_compression.yml
deleted file mode 100644
index 0580efcf1d7..00000000000
--- a/buildscripts/resmokeconfig/suites/replica_sets_compression.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-selector:
- js_test:
- roots:
- - jstests/replsets/*.js
- exclude_files:
- # Disable config_server_checks.js since it starts mmap servers.
- - jstests/replsets/config_server_checks.js
-
-executor:
- js_test:
- config:
- shell_options:
- nodb: ''
- global_vars:
- TestData:
- networkMessageCompressors: snappy
- readMode: commands
diff --git a/buildscripts/resmokeconfig/suites/sharding_compression.yml b/buildscripts/resmokeconfig/suites/sharding_compression.yml
deleted file mode 100644
index f6351df4c3d..00000000000
--- a/buildscripts/resmokeconfig/suites/sharding_compression.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-selector:
- js_test:
- roots:
- - jstests/sharding/*.js
-
-executor:
- js_test:
- config:
- shell_options:
- global_vars:
- TestData:
- networkMessageCompressors: snappy
- nodb: ''
- readMode: commands
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index d0d8b1d9b20..c9b90810504 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -2153,17 +2153,6 @@ tasks:
run_multiple_jobs: true
- <<: *task_template
- name: jsCore_compression
- depends_on:
- - name: jsCore_WT
- commands:
- - func: "do setup"
- - func: "run tests"
- vars:
- resmoke_args: --suites=core_compression
- run_multiple_jobs: true
-
-- <<: *task_template
name: jsCore_auth
depends_on:
- name: jsCore
@@ -2759,15 +2748,6 @@ tasks:
run_multiple_jobs: true
- <<: *task_template
- name: replica_sets_compression
- commands:
- - func: "do setup"
- - func: "run tests"
- vars:
- resmoke_args: --suites=replica_sets_compression
- run_multiple_jobs: true
-
-- <<: *task_template
name: replica_sets_pv0
commands:
- func: "do setup"
@@ -2833,15 +2813,6 @@ tasks:
run_multiple_jobs: true
- <<: *task_template
- name: sharding_compression
- commands:
- - func: "do setup"
- - func: "run tests"
- vars:
- resmoke_args: --suites=sharding_compression
- run_multiple_jobs: true
-
-- <<: *task_template
name: sharding_csrs_continuous_config_stepdown_WT
commands:
- func: "do setup"
@@ -4548,7 +4519,6 @@ buildvariants:
- name: sharding_gle_auth_basics_passthrough_write_cmd_WT
- name: jsCore_WT
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal_WT
- name: jstestfuzz_WT
- name: jstestfuzz_concurrent_WT
@@ -4642,7 +4612,6 @@ buildvariants:
- name: jsCore_WT
- name: jsCore_WT_ese
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal_WT
- name: jsCore_op_query_WT
- name: jstestfuzz_WT
@@ -4661,7 +4630,6 @@ buildvariants:
- name: replica_sets_WT
- name: replica_sets_WT_ese
- name: replica_sets_auth
- - name: replica_sets_compression
- name: replica_sets_pv0
- name: replica_sets_jscore_passthrough_WT
- name: master_slave_WT
@@ -4673,7 +4641,6 @@ buildvariants:
- name: sharding_WT_ese
- name: sharding_auth
- name: sharding_auth_audit_WT
- - name: sharding_compression
- name: sharding_csrs_continuous_config_stepdown_WT
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd_WT
@@ -4959,7 +4926,6 @@ buildvariants:
- name: jsCore_WT
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: mmap
@@ -5255,7 +5221,6 @@ buildvariants:
- name: jsCore_WT
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jstestfuzz
@@ -5293,7 +5258,6 @@ buildvariants:
- name: read_concern_majority_passthrough_WT
- name: replica_sets
- name: replica_sets_WT
- - name: replica_sets_compression
- name: replica_sets_jscore_passthrough
- name: replica_sets_jscore_passthrough_WT
- name: serial_run
@@ -5302,7 +5266,6 @@ buildvariants:
- name: sharded_collections_jscore_passthrough_WT
- name: sharding
- name: sharding_WT
- - name: sharding_compression
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd
@@ -5405,7 +5368,6 @@ buildvariants:
- name: jsCore_WT
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jstestfuzz
@@ -5437,7 +5399,6 @@ buildvariants:
- name: read_concern_majority_passthrough_WT
- name: replica_sets
- name: replica_sets_WT
- - name: replica_sets_compression
- name: replica_sets_jscore_passthrough
- name: replica_sets_jscore_passthrough_WT
- name: replica_sets_kill_secondaries_jscore_passthrough_WT
@@ -5646,7 +5607,6 @@ buildvariants:
- name: jsCore_auth
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jsCore_minimum_batch_size_WT
@@ -5705,9 +5665,6 @@ buildvariants:
- name: replica_sets_auth
distros:
- rhel62-large
- - name: replica_sets_compression
- distros:
- - rhel62-large
- name: replica_sets_pv0
distros:
- rhel62-large
@@ -5763,9 +5720,6 @@ buildvariants:
- name: sharding_auth_audit_WT
distros:
- rhel62-large
- - name: sharding_compression
- distros:
- - rhel62-large
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd
@@ -5892,7 +5846,6 @@ buildvariants:
- name: jsCore_auth
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jsCore_minimum_batch_size_WT
@@ -5937,9 +5890,6 @@ buildvariants:
- name: replica_sets_auth
distros:
- rhel62-large
- - name: replica_sets_compression
- distros:
- - rhel62-large
- name: replica_sets_pv0
distros:
- rhel62-large
@@ -5993,9 +5943,6 @@ buildvariants:
- name: sharding_auth_audit_WT
distros:
- rhel62-large
- - name: sharding_compression
- distros:
- - rhel62-large
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd
@@ -8479,7 +8426,6 @@ buildvariants:
- name: jsCore_auth
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jsCore_minimum_batch_size_WT
@@ -8510,7 +8456,6 @@ buildvariants:
- name: replica_sets_WT
- name: replica_sets_WT_ese
- name: replica_sets_auth
- - name: replica_sets_compression
- name: replica_sets_pv0
- name: replica_sets_jscore_passthrough
- name: replica_sets_jscore_passthrough_WT
@@ -8534,7 +8479,6 @@ buildvariants:
- name: sharding_WT_ese
- name: sharding_auth
- name: sharding_auth_audit_WT
- - name: sharding_compression
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd
@@ -8661,7 +8605,6 @@ buildvariants:
- name: jsCore_auth
- name: jsCore_compatibility
- name: jsCore_compatibility_WT
- - name: jsCore_compression
- name: jsCore_decimal
- name: jsCore_decimal_WT
- name: jsCore_minimum_batch_size_WT
@@ -8692,7 +8635,6 @@ buildvariants:
- name: replica_sets_WT
- name: replica_sets_WT_ese
- name: replica_sets_auth
- - name: replica_sets_compression
- name: replica_sets_pv0
- name: replica_sets_jscore_passthrough
- name: replica_sets_jscore_passthrough_WT
@@ -8716,7 +8658,6 @@ buildvariants:
- name: sharding_WT_ese
- name: sharding_auth
- name: sharding_auth_audit_WT
- - name: sharding_compression
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_WT
- name: sharding_gle_auth_basics_passthrough_write_cmd
diff --git a/jstests/noPassthrough/compression_options.js b/jstests/noPassthrough/compression_options.js
new file mode 100644
index 00000000000..acbb1d66ba7
--- /dev/null
+++ b/jstests/noPassthrough/compression_options.js
@@ -0,0 +1,44 @@
+// Checks storage-engine specific sections of db.severStatus() output.
+
+(function() {
+ 'use strict';
+
+ var runTest = function(optionValue, expected) {
+ jsTest.log("Testing with --networkMessageCompressors=\"" + optionValue + "\" expecting: " +
+ expected);
+ var mongo = MongoRunner.runMongod({networkMessageCompressors: optionValue});
+ assert.commandWorked(mongo.adminCommand({isMaster: 1}));
+ clearRawMongoProgramOutput();
+ assert.eq(runMongoProgram("mongo",
+ "--eval",
+ "tostrictjson(db.isMaster());",
+ "--port",
+ mongo.port,
+ "--networkMessageCompressors=snappy"),
+ 0);
+
+ var output = rawMongoProgramOutput()
+ .split("\n")
+ .map(function(str) {
+ str = str.replace(/^sh[0-9]+\| /, "");
+ if (!/^{/.test(str)) {
+ return "";
+ }
+ return str;
+ })
+ .join("\n")
+ .trim();
+
+ output = JSON.parse(output);
+
+ assert.eq(output.compression, expected);
+ MongoRunner.stopMongod(mongo.port);
+ };
+
+ assert.isnull(MongoRunner.runMongod({networkMessageCompressors: "snappy,disabled"}));
+
+ runTest("snappy", ["snappy"]);
+ runTest("disabled", undefined);
+ runTest("", undefined);
+
+}());
diff --git a/src/mongo/transport/message_compressor_registry.cpp b/src/mongo/transport/message_compressor_registry.cpp
index a9cf4cda0b9..46b464b3f07 100644
--- a/src/mongo/transport/message_compressor_registry.cpp
+++ b/src/mongo/transport/message_compressor_registry.cpp
@@ -40,6 +40,10 @@
#include <boost/algorithm/string/split.hpp>
namespace mongo {
+namespace {
+const auto kDisabledConfigValue = "disabled"_sd;
+const auto kDefaultConfigValue = "snappy"_sd;
+} // namespace
StringData getMessageCompressorName(MessageCompressor id) {
switch (id) {
@@ -111,7 +115,8 @@ Status addMessageCompressionOptions(moe::OptionSection* options, bool forShell)
"networkMessageCompressors",
moe::String,
"Comma-separated list of compressors to use for network messages")
- .setImplicit(moe::Value(std::string("")));
+ .setDefault(moe::Value(kDefaultConfigValue.toString()))
+ .setImplicit(moe::Value(kDisabledConfigValue.toString()));
if (forShell)
ret.hidden();
@@ -122,7 +127,9 @@ Status storeMessageCompressionOptions(const moe::Environment& params) {
std::vector<std::string> restrict;
if (params.count("net.compression.compressors")) {
auto compressorListStr = params["net.compression.compressors"].as<std::string>();
- boost::algorithm::split(restrict, compressorListStr, boost::is_any_of(", "));
+ if (compressorListStr != kDisabledConfigValue) {
+ boost::algorithm::split(restrict, compressorListStr, boost::is_any_of(", "));
+ }
}
auto& compressorFactory = MessageCompressorRegistry::get();