summaryrefslogtreecommitdiff
path: root/src/mongo/embedded
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2019-12-19 13:59:01 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-01-30 00:53:40 +0000
commitbeb9ffb3b326e22bea6e34abf17be8a2bc53df0a (patch)
tree36b1d85221c9815815067370c7a03d2cc84d4d92 /src/mongo/embedded
parent31d27b87be16f2ebb5fd76cd8aef9ab65378def4 (diff)
downloadmongo-beb9ffb3b326e22bea6e34abf17be8a2bc53df0a.tar.gz
SERVER-44548 Switch embedded over to use wiredtiger
delete mode 100644 src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in delete mode 100644 src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in delete mode 100644 src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in
Diffstat (limited to 'src/mongo/embedded')
-rw-r--r--src/mongo/embedded/SConscript3
-rw-r--r--src/mongo/embedded/embedded_options.cpp12
-rw-r--r--src/mongo/embedded/embedded_options.idl2
-rw-r--r--src/mongo/embedded/mongo_embedded/SConscript1
-rw-r--r--src/mongo/embedded/mongo_embedded/mongo_embedded.cpp77
-rw-r--r--src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in33
-rw-r--r--src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp10
-rw-r--r--src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in31
-rw-r--r--src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in33
-rw-r--r--src/mongo/embedded/replication_coordinator_embedded.cpp2
10 files changed, 44 insertions, 160 deletions
diff --git a/src/mongo/embedded/SConscript b/src/mongo/embedded/SConscript
index a3788007ce6..14002f1dce1 100644
--- a/src/mongo/embedded/SConscript
+++ b/src/mongo/embedded/SConscript
@@ -4,6 +4,7 @@ import re
Import("env")
Import("get_option")
+Import("wiredtiger")
env = env.Clone()
@@ -113,7 +114,7 @@ env.Library(
'$BUILD_DIR/mongo/db/service_entry_point_common',
'$BUILD_DIR/mongo/db/service_liaison_mongod',
'$BUILD_DIR/mongo/db/sessions_collection_standalone',
- '$BUILD_DIR/mongo/db/storage/mobile/storage_mobile',
+ '$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger' if wiredtiger else [],
'$BUILD_DIR/mongo/db/storage/storage_engine_common',
'$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
'$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
diff --git a/src/mongo/embedded/embedded_options.cpp b/src/mongo/embedded/embedded_options.cpp
index 8ffe6f93ce6..117d7e4b245 100644
--- a/src/mongo/embedded/embedded_options.cpp
+++ b/src/mongo/embedded/embedded_options.cpp
@@ -33,7 +33,6 @@
#include "mongo/db/server_options_base.h"
#include "mongo/db/server_options_helpers.h"
-#include "mongo/db/storage/mobile/mobile_options_gen.h"
#include "mongo/db/storage/storage_options.h"
#include "mongo/embedded/embedded_options_gen.h"
@@ -51,11 +50,6 @@ Status addOptions(optionenvironment::OptionSection* options) {
return ret;
}
- ret = addMobileStorageOptionDefinitions(options);
- if (!ret.isOK()) {
- return ret;
- }
-
return embedded::addStorageOptions(options);
}
@@ -84,11 +78,6 @@ Status storeOptions(const moe::Environment& params) {
storageGlobalParams.dbpath = params["storage.dbPath"].as<string>();
}
- ret = storeMobileStorageOptionDefinitions(params);
- if (!ret.isOK()) {
- return ret;
- }
-
#ifdef _WIN32
if (storageGlobalParams.dbpath.size() > 1 &&
storageGlobalParams.dbpath[storageGlobalParams.dbpath.size() - 1] == '/') {
@@ -113,7 +102,6 @@ Status storeOptions(const moe::Environment& params) {
void resetOptions() {
storageGlobalParams.reset();
- mobileGlobalOptions = MobileOptions();
}
std::string storageDBPathDescription() {
diff --git a/src/mongo/embedded/embedded_options.idl b/src/mongo/embedded/embedded_options.idl
index 070ce9aa5ce..7c857e99b6b 100644
--- a/src/mongo/embedded/embedded_options.idl
+++ b/src/mongo/embedded/embedded_options.idl
@@ -41,7 +41,6 @@ configs:
description: 'What storage engine to use'
short_name: storageEngine
arg_vartype: String
- default: mobile
'storage.dbPath':
description:
@@ -49,4 +48,3 @@ configs:
is_constexpr: false
short_name: dbpath
arg_vartype: String
-
diff --git a/src/mongo/embedded/mongo_embedded/SConscript b/src/mongo/embedded/mongo_embedded/SConscript
index 8cf4efcf6be..44f7c02ebec 100644
--- a/src/mongo/embedded/mongo_embedded/SConscript
+++ b/src/mongo/embedded/mongo_embedded/SConscript
@@ -96,7 +96,6 @@ 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.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp
index e75edd1c0a3..1004122469b 100644
--- a/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp
+++ b/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp
@@ -132,7 +132,7 @@ MongoEmbeddedStatusImpl* getStatusImpl(mongo_embedded_v1_status* status) {
return status ? &status->statusImpl : nullptr;
}
-using MobileException = ExceptionForAPI<mongo_embedded_v1_error>;
+using EmbeddedException = ExceptionForAPI<mongo_embedded_v1_error>;
struct ServiceContextDestructor {
void operator()(mongo::ServiceContext* const serviceContext) const noexcept {
@@ -160,7 +160,7 @@ struct mongo_embedded_v1_instance {
// creating mock transport layer to be able to create sessions
transportLayer(std::make_unique<mongo::transport::TransportLayerMock>()) {
if (!this->serviceContext) {
- throw ::mongo::MobileException{
+ throw ::mongo::EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_DB_INITIALIZATION_FAILED,
"The MongoDB Embedded Library Failed to initialize the Service Context"};
}
@@ -215,7 +215,7 @@ void registerLogCallback(mongo_embedded_v1_lib* const lib,
mongo_embedded_v1_lib* capi_lib_init(mongo_embedded_v1_init_params const* params) try {
if (library) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_LIBRARY_ALREADY_INITIALIZED,
"Cannot initialize the MongoDB Embedded Library when it is already initialized."};
}
@@ -257,27 +257,27 @@ mongo_embedded_v1_lib* capi_lib_init(mongo_embedded_v1_init_params const* params
void capi_lib_fini(mongo_embedded_v1_lib* const lib) {
if (!lib) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE,
"Cannot close a `NULL` pointer referencing a MongoDB Embedded Library Instance"};
}
if (!library) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
"Cannot close the MongoDB Embedded Library when it is not initialized"};
}
if (library.get() != lib) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE,
- "Invalid MongoDB Embedded Library handle."};
+ throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE,
+ "Invalid MongoDB Embedded Library handle."};
}
// This check is not possible to 100% guarantee. It is a best effort. The documentation of
// this API says that the behavior of closing a `lib` with open handles is undefined, but may
// provide diagnostic errors in some circumstances.
if (lib->databaseCount.load() > 0) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_HAS_DB_HANDLES_OPEN,
"Cannot close the MongoDB Embedded Library when it has database handles still open."};
}
@@ -288,21 +288,21 @@ void capi_lib_fini(mongo_embedded_v1_lib* const lib) {
mongo_embedded_v1_instance* instance_new(mongo_embedded_v1_lib* const lib,
const char* const yaml_config) {
if (!library) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
- "Cannot create a new database handle when the MongoDB Embedded "
- "Library is not yet initialized."};
+ throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
+ "Cannot create a new database handle when the MongoDB Embedded "
+ "Library is not yet initialized."};
}
if (library.get() != lib) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE,
- "Cannot create a new database handle when the MongoDB Embedded "
- "Library is not yet initialized."};
+ throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE,
+ "Cannot create a new database handle when the MongoDB Embedded "
+ "Library is not yet initialized."};
}
if (lib->onlyDB) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_DB_MAX_OPEN,
- "The maximum number of permitted database handles for the MongoDB "
- "Embedded Library have been opened."};
+ throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_DB_MAX_OPEN,
+ "The maximum number of permitted database handles for the MongoDB "
+ "Embedded Library have been opened."};
}
lib->onlyDB = std::make_unique<mongo_embedded_v1_instance>(lib, yaml_config);
@@ -312,25 +312,26 @@ mongo_embedded_v1_instance* instance_new(mongo_embedded_v1_lib* const lib,
void instance_destroy(mongo_embedded_v1_instance* const db) {
if (!library) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
- "Cannot destroy a database handle when the MongoDB Embedded Library "
- "is not yet initialized."};
+ throw EmbeddedException{
+ MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
+ "Cannot destroy a database handle when the MongoDB Embedded Library "
+ "is not yet initialized."};
}
if (!db) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
"Cannot close a `NULL` pointer referencing a MongoDB Embedded Database"};
}
if (db != library->onlyDB.get()) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
"Cannot close the specified MongoDB Embedded Database, as it is not a valid instance."};
}
if (db->clientCount.load() > 0) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_DB_CLIENTS_OPEN,
"Cannot close a MongoDB Embedded Database instance while it has open clients"};
}
@@ -340,21 +341,24 @@ void instance_destroy(mongo_embedded_v1_instance* const db) {
mongo_embedded_v1_client* client_new(mongo_embedded_v1_instance* const db) {
if (!library) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
- "Cannot create a new client handle when the MongoDB Embedded Library "
- "is not yet initialized."};
+ throw EmbeddedException{
+ MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
+ "Cannot create a new client handle when the MongoDB Embedded Library "
+ "is not yet initialized."};
}
if (!db) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
- "Cannot use a `NULL` pointer referencing a MongoDB Embedded Database "
- "when creating a new client"};
+ throw EmbeddedException{
+ MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
+ "Cannot use a `NULL` pointer referencing a MongoDB Embedded Database "
+ "when creating a new client"};
}
if (db != library->onlyDB.get()) {
- throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
- "The specified MongoDB Embedded Database instance cannot be used to "
- "create a new client because it is invalid."};
+ throw EmbeddedException{
+ MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE,
+ "The specified MongoDB Embedded Database instance cannot be used to "
+ "create a new client because it is invalid."};
}
return new mongo_embedded_v1_client(db);
@@ -362,13 +366,14 @@ mongo_embedded_v1_client* client_new(mongo_embedded_v1_instance* const db) {
void client_destroy(mongo_embedded_v1_client* const client) {
if (!library) {
- throw MobileException(MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
- "Cannot destroy a database handle when the MongoDB Embedded Library "
- "is not yet initialized.");
+ throw EmbeddedException(
+ MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED,
+ "Cannot destroy a database handle when the MongoDB Embedded Library "
+ "is not yet initialized.");
}
if (!client) {
- throw MobileException{
+ throw EmbeddedException{
MONGO_EMBEDDED_V1_ERROR_INVALID_CLIENT_HANDLE,
"Cannot destroy a `NULL` pointer referencing a MongoDB Embedded Database Client"};
}
diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in b/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in
deleted file mode 100644
index dd44766f09f..00000000000
--- a/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in
+++ /dev/null
@@ -1,33 +0,0 @@
-Pod::Spec.new do |s|
-
- s.name = "mongo_embedded"
- s.version = "@VERSION@"
- s.summary = "MongoDB Embedded"
-
- s.description = <<-DESC
- An embedded library providing access to the MongoDB query language over local storage
- DESC
-
- s.homepage = "https://www.mongodb.com"
- s.author = { "MongoDB, Inc" => "cocoapods@mongodb.com" }
-
- s.license = { :type => "MongoDB Embedded License", :file => "iPhoneOS/Frameworks/mongo_embedded.framework/LICENSE-Embedded.txt" }
-
- s.ios.deployment_target = "11.0"
- s.watchos.deployment_target = "4.3"
- s.tvos.deployment_target = "10.2"
-
- s.source = { :http => "https://downloads.mongodb.org/mobile/apple/mongo-embedded-sdk-@VERSION@.tgz"
- :sha256 => "@SHA256@" }
-
- s.ios.vendored_frameworks = "iPhoneOS/Frameworks/mongo_embedded.framework"
- s.watchos.vendored_frameworks = "WatchOS/Frameworks/mongo_embedded.framework"
- s.tvos.vendored_frameworks = "AppleTVOS/Frameworks/mongo_embedded.framework"
-
- # My current best understanding is that apple uses these to inject
- # back in when running dsymutil on their side after regenerating a
- # binary from the bitcode slices. So we need to keep these available
- # in the pod so they get archived into end user application.
- s.preserve_path = '**/*.bcsymbolmap'
-
-end
diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
index 9bc12aeba19..a3755223912 100644
--- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
+++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
@@ -39,7 +39,6 @@
#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"
@@ -110,9 +109,6 @@ 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;
@@ -120,10 +116,6 @@ 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;
@@ -135,8 +127,6 @@ 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() {
diff --git a/src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in b/src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in
deleted file mode 100644
index 39b0f03e726..00000000000
--- a/src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in
+++ /dev/null
@@ -1,31 +0,0 @@
-Pod::Spec.new do |s|
-
- s.name = "mongo-embedded-c-driver"
- s.version = "@VERSION@"
- s.summary = "MongoDB C Driver"
-
- s.description = <<-DESC
- mongo-c-driver is a project that includes two libraries:
- libmongoc, a client library written in C for MongoDB.
- libbson, a library providing useful routines related to building, parsing, and iterating BSON documents.
- DESC
-
- s.homepage = "https://www.mongodb.com"
- s.author = { "MongoDB, Inc" => "cocoapods@mongodb.com" }
-
- s.license = { :type => "Apache License, Version 2.0", :file => "iPhoneOS/Frameworks/mongoc.framework/COPYING" }
-
- s.ios.deployment_target = "11.0"
- s.osx.deployment_target = "10.10"
- s.watchos.deployment_target = "4.3"
- s.tvos.deployment_target = "10.2"
-
- s.source = { :http => "https://downloads.mongodb.org/mobile/apple/mongo-c-driver-@VERSION@-@MONGO_VERSION@.tgz",
- :sha256 => "@SHA256@" }
-
- s.ios.vendored_frameworks = "iPhoneOS/Frameworks/bson.framework", "iPhoneOS/Frameworks/mongoc.framework"
- s.osx.vendored_frameworks = "MacOS/Frameworks/bson.framework", "MacOS/Frameworks/mongoc.framework"
- s.watchos.vendored_frameworks = "WatchOS/Frameworks/bson.framework", "WatchOS/Frameworks/mongoc.framework"
- s.tvos.vendored_frameworks = "AppleTVOS/Frameworks/bson.framework", "AppleTVOS/Frameworks/mongoc.framework"
-
-end
diff --git a/src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in b/src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in
deleted file mode 100644
index 6a28021dea2..00000000000
--- a/src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in
+++ /dev/null
@@ -1,33 +0,0 @@
-Pod::Spec.new do |s|
-
- s.name = "mongoc_embedded"
- s.version = "@VERSION@"
- s.summary = "MongoDB Embedded C Driver Transport"
-
- s.description = <<-DESC
- Library providing a client usable by the regular MongoDB C Driver that communicates with the MongoDB Embedded local storage.
- DESC
-
- s.homepage = "https://www.mongodb.com"
- s.author = { "MongoDB, Inc" => "cocoapods@mongodb.com" }
-
- s.license = { :type => "MongoDB Embedded License", :file => "iPhoneOS/Frameworks/mongoc_embedded.framework/LICENSE-Embedded.txt" }
-
- s.ios.deployment_target = "11.0"
- s.watchos.deployment_target = "4.3"
- s.tvos.deployment_target = "10.2"
-
- s.source = { :http => "https://downloads.mongodb.org/mobile/apple/mongoc-embedded-sdk-@VERSION@.tgz",
- :sha256 => "@SHA256@" }
-
- s.ios.vendored_frameworks = "iPhoneOS/Frameworks/mongoc_embedded.framework"
- s.watchos.vendored_frameworks = "WatchOS/Frameworks/mongoc_embedded.framework"
- s.tvos.vendored_frameworks = "AppleTVOS/Frameworks/mongoc_embedded.framework"
-
- s.dependency "mongo_embedded", "~> 4.0"
- s.dependency "mongo-c-driver", "~> 1.13"
-
- # See notes in mongo_embedded.podspec.in.
- s.preserve_path = '**/*.bcsymbolmap'
-
-end
diff --git a/src/mongo/embedded/replication_coordinator_embedded.cpp b/src/mongo/embedded/replication_coordinator_embedded.cpp
index 30e05ca4b49..fbf1f3a8b43 100644
--- a/src/mongo/embedded/replication_coordinator_embedded.cpp
+++ b/src/mongo/embedded/replication_coordinator_embedded.cpp
@@ -154,7 +154,7 @@ void ReplicationCoordinatorEmbedded::appendConnectionStats(
}
MemberState ReplicationCoordinatorEmbedded::getMemberState() const {
- UASSERT_NOT_IMPLEMENTED;
+ return MemberState::RS_PRIMARY;
}
std::vector<repl::MemberData> ReplicationCoordinatorEmbedded::getMemberData() const {