summaryrefslogtreecommitdiff
path: root/src/mongo/embedded/mongo_embedded
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-04-11 14:32:36 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2019-04-24 11:15:31 -0400
commit9e4f12393b4a468175f9f0a6cc74dd669bf1fd5e (patch)
treeaa76481db392f7bcd266074a6a29ffa3f0d60097 /src/mongo/embedded/mongo_embedded
parentf202c4c1ba24b9f561e8b11dac5b04fa0eeb4919 (diff)
downloadmongo-9e4f12393b4a468175f9f0a6cc74dd669bf1fd5e.tar.gz
SERVER-40125 Add a periodic job that runs incremental vacuum on the mobile storage engine.
Also fix options and parameter handling for the mobile storage engine options.
Diffstat (limited to 'src/mongo/embedded/mongo_embedded')
-rw-r--r--src/mongo/embedded/mongo_embedded/SConscript1
-rw-r--r--src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/embedded/mongo_embedded/SConscript b/src/mongo/embedded/mongo_embedded/SConscript
index fe143671726..42b533801c8 100644
--- a/src/mongo/embedded/mongo_embedded/SConscript
+++ b/src/mongo/embedded/mongo_embedded/SConscript
@@ -101,6 +101,7 @@ if get_option('link-model') != 'dynamic-sdk':
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/server_options_core',
+ '$BUILD_DIR/mongo/db/storage/mobile/storage_mobile_core',
'$BUILD_DIR/mongo/rpc/protocol',
'$BUILD_DIR/mongo/unittest/unittest',
'$BUILD_DIR/mongo/util/net/network',
diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
index 510b467733d..1cde189eb41 100644
--- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
+++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
@@ -39,6 +39,7 @@
#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/json.h"
#include "mongo/db/server_options.h"
+#include "mongo/db/storage/mobile/mobile_options.h"
#include "mongo/embedded/mongo_embedded/mongo_embedded_test_gen.h"
#include "mongo/rpc/message.h"
#include "mongo/rpc/op_msg.h"
@@ -108,6 +109,9 @@ protected:
params.log_callback = nullptr;
params.log_user_data = nullptr;
+ // Set a parameter that lives in mobileGlobalOptions to verify it can be set using YAML.
+ uint32_t vacuumCheckIntervalMinutes = 1;
+
YAML::Emitter yaml;
yaml << YAML::BeginMap;
@@ -115,6 +119,10 @@ protected:
yaml << YAML::Value << YAML::BeginMap;
yaml << YAML::Key << "dbPath";
yaml << YAML::Value << globalTempDir->path();
+ yaml << YAML::Key << "mobile" << YAML::BeginMap;
+ yaml << YAML::Key << "vacuumCheckIntervalMinutes" << YAML::Value
+ << vacuumCheckIntervalMinutes;
+ yaml << YAML::EndMap; // mobile
yaml << YAML::EndMap; // storage
yaml << YAML::EndMap;
@@ -126,6 +134,8 @@ protected:
db = mongo_embedded_v1_instance_create(lib, yaml.c_str(), status);
ASSERT(db != nullptr) << mongo_embedded_v1_status_get_explanation(status);
+ ASSERT(mongo::embedded::mobileGlobalOptions.vacuumCheckIntervalMinutes ==
+ vacuumCheckIntervalMinutes);
}
void tearDown() {