Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From be4275d5af4f59024ebcfeb677706687c670611a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Wed, 22 Jul 2015 15:12:27 +0200
Subject: [PATCH] fix compilation errors with v8-3.25

---
src/mongo/scripting/engine_v8-3.25.cpp | 6 +++---
src/mongo/scripting/v8-3.25_db.cpp | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mongo/scripting/engine_v8-3.25.cpp b/src/mongo/scripting/engine_v8-3.25.cpp
index 14b2a43..bfbb3ce 100644
--- a/src/mongo/scripting/engine_v8-3.25.cpp
+++ b/src/mongo/scripting/engine_v8-3.25.cpp
@@ -1501,7 +1501,7 @@ v8::Local<v8::Value> V8Scope::mongoToV8Element(const BSONElement& elem, bool rea
case mongo::Object:
return mongoToLZV8(elem.embeddedObject(), readOnly);
case mongo::Date:
- return v8::Date::New(_isolate, static_cast<double>(elem.date.toMillisSinceEpoch()));
+ return v8::Date::New(_isolate, static_cast<double>(elem.Date().toMillisSinceEpoch()));
case mongo::Bool:
return v8::Boolean::New(_isolate, elem.boolean());
case mongo::EOO:
@@ -1536,7 +1536,7 @@ v8::Local<v8::Value> V8Scope::mongoToV8Element(const BSONElement& elem, bool rea
case mongo::bsonTimestamp: {
v8::TryCatch tryCatch;

- argv[0] = v8::Number::New(_isolate, elem.timestampTime() / 1000);
+ argv[0] = v8::Number::New(_isolate, elem.timestampTime().toMillisSinceEpoch() / 1000);
argv[1] = v8::Number::New(_isolate, elem.timestampInc());

v8::Local<v8::Value> ret = TimestampFT()->GetFunction()->NewInstance(2, argv);
@@ -1721,7 +1721,7 @@ void V8Scope::v8ToMongoElement(BSONObjBuilder& b,
}
if (value->IsDate()) {
long long dateval = (long long)(v8::Date::Cast(*value)->NumberValue());
- b.appendDate(sname, Date_t((unsigned long long)dateval));
+ b.appendDate(sname, Date_t().fromMillisSinceEpoch((unsigned long long)dateval));
return;
}
if (value->IsExternal())
diff --git a/src/mongo/scripting/v8-3.25_db.cpp b/src/mongo/scripting/v8-3.25_db.cpp
index e4fd6d8..9e81974 100644
--- a/src/mongo/scripting/v8-3.25_db.cpp
+++ b/src/mongo/scripting/v8-3.25_db.cpp
@@ -42,6 +42,7 @@
#include "mongo/util/base64.h"
#include "mongo/util/hex.h"
#include "mongo/util/text.h"
+#include "mongo/bson/timestamp.h"

using namespace std;
using std::unique_ptr;
@@ -135,7 +136,7 @@ v8::Local<v8::Value> mongoConsExternal(V8Scope* scope,
verify(scope->MongoFT()->HasInstance(args.This()));

auto statusWithHost = ConnectionString::parse(host);
- if (!status.isOK()) {
+ if (!statusWithHost.isOK()) {
return v8AssertionException(statusWithHost.getStatus().reason());
}

@@ -774,7 +775,7 @@ v8::Local<v8::Value> dbTimestampInit(V8Scope* scope,
return v8AssertionException("Timestamp increment must be a number");
}
int64_t t = args[0]->IntegerValue();
- int64_t largestVal = int64_t(OpTime::max().getSecs());
+ int64_t largestVal = int64_t(Timestamp::max().getSecs());
if (t > largestVal)
return v8AssertionException(str::stream() << "The first argument must be in seconds; "
<< t << " is too large (max " << largestVal
--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 4bafababda82061329c705f80c58e555bb21d407 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Tue, 21 Jul 2015 08:18:17 +0200
Subject: [PATCH] fix missing boost library in third party src

---
SConstruct | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SConstruct b/SConstruct
index 5c8d414..aa22aed 100644
--- a/SConstruct
+++ b/SConstruct
@@ -729,7 +729,7 @@ def printLocalInfo():

printLocalInfo()

-boostLibs = [ "thread" , "filesystem" , "program_options", "system" ]
+boostLibs = [ "thread" , "filesystem" , "program_options", "system", "chrono" ]

onlyServer = len( COMMAND_LINE_TARGETS ) == 0 or ( len( COMMAND_LINE_TARGETS ) == 1 and str( COMMAND_LINE_TARGETS[0] ) in [ "mongod" , "mongos" , "test" ] )

--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From e79f7c8ae7b0ff2459a8136106a0692594ba0202 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Tue, 21 Jul 2015 11:17:19 +0200
Subject: [PATCH] fix missing search for system asio libs

---
SConstruct | 3 +++
src/third_party/SConscript | 6 ++----
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/SConstruct b/SConstruct
index 1f38ab7..ba91d2a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2203,6 +2203,9 @@ def doConfigure(myenv):
"""):
conf.env.SetConfigHeaderDefine('MONGO_CONFIG_HAVE_FIPS_MODE_SET')

+ if use_system_version_of_library("asio"):
+ conf.CheckCXXHeader("boost/asio.hpp")
+
return conf.Finish()

env = doConfigure( env )
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 594ea27..e1b4b88 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -162,6 +162,7 @@ if use_system_version_of_library("zlib"):
SYSLIBDEPS=[
env['LIBDEPS_ZLIB_SYSLIBDEP'],
])
+ print("syslibdep: {}".format(env['LIBDEPS_ZLIB_SYSLIBDEP']))
else:
zlibEnv = env.Clone()
zlibEnv.InjectThirdPartyIncludePaths(libraries=['zlib'])
@@ -304,10 +305,7 @@ if wiredtiger:
])

if use_system_version_of_library("asio"):
- asioEnv = env.Clone(
- SYSLIBDEPS=[
- env['LIBDEPS_ASIO_SYSLIBDEP'],
- ])
+ asioEnv = env.Clone([])
else:
asioEnv = env.Clone()
asioEnv.InjectThirdPartyIncludePaths(libraries=['asio'])
--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 53f27a872a3ec7591a437a35c577509033a35d19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Thu, 23 Jul 2015 10:35:34 +0200
Subject: [PATCH] include operation context to allow dereferencing

---
src/mongo/scripting/v8-3.25_db.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/mongo/scripting/v8-3.25_db.cpp b/src/mongo/scripting/v8-3.25_db.cpp
index e4fd6d8..bef068c 100644
--- a/src/mongo/scripting/v8-3.25_db.cpp
+++ b/src/mongo/scripting/v8-3.25_db.cpp
@@ -35,6 +35,7 @@
#include "mongo/base/init.h"
#include "mongo/client/sasl_client_authenticate.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/db/operation_context.h"
#include "mongo/s/d_state.h"
#include "mongo/scripting/engine_v8-3.25.h"
#include "mongo/scripting/v8-3.25_utils.h"
--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 271460f8cad7d6c114e62b4d91859b1864c07716 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Tue, 21 Jul 2015 07:25:27 +0200
Subject: [PATCH] propagate execution environment into SCons

---
SConstruct | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SConstruct b/SConstruct
index 2a7ee46..0f05ee9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -791,7 +791,7 @@ envDict = dict(BUILD_ROOT=buildDir,
CONFIG_HEADER_DEFINES={},
)

-env = Environment(variables=env_vars, **envDict)
+env = Environment(variables=env_vars, ENV=os.environ, **envDict)
del envDict

env.AddMethod(env_os_is_wrapper, 'TargetOSIs')
--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 26c0780746aecedf9d6fb73f0171620790638000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Wed, 22 Jul 2015 14:26:03 +0200
Subject: [PATCH] remove char arguments to boost::mutex constructors

---
src/mongo/scripting/engine_v8-3.25.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mongo/scripting/engine_v8-3.25.cpp b/src/mongo/scripting/engine_v8-3.25.cpp
index b7f241c..14b2a43 100644
--- a/src/mongo/scripting/engine_v8-3.25.cpp
+++ b/src/mongo/scripting/engine_v8-3.25.cpp
@@ -382,7 +382,7 @@ void gcCallback(v8::GCType type, v8::GCCallbackFlags flags) {
}

V8ScriptEngine::V8ScriptEngine()
- : _globalInterruptLock("GlobalV8InterruptLock"), _opToScopeMap(), _deadlineMonitor() {}
+ : _globalInterruptLock(), _opToScopeMap(), _deadlineMonitor() {}

V8ScriptEngine::~V8ScriptEngine() {}

@@ -525,7 +525,7 @@ V8Scope::V8Scope(V8ScriptEngine* engine)
: _engine(engine),
_connectState(NOT),
_cpuProfiler(),
- _interruptLock("ScopeInterruptLock"),
+ _interruptLock(),
_inNativeExecution(true),
_pendingKill(false),
_opId(0),
--
2.4.6

24 changes: 24 additions & 0 deletions recipes/mongodb/files/0001-remove-debug-flag-from-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From fa0455b9e9cb61afd90e07c5fdf9fb3517bd06c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Thu, 23 Jul 2015 11:57:23 +0200
Subject: [PATCH] remove debug flag from build

---
SConstruct | 1 -
1 file changed, 1 deletion(-)

diff --git a/SConstruct b/SConstruct
index 0a3273a..908d726 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1216,7 +1216,6 @@ if env.TargetOSIs('posix'):
env.Append( CCFLAGS=["-fno-omit-frame-pointer",
"-fPIC",
"-fno-strict-aliasing",
- "-ggdb",
"-pthread",
"-Wall",
"-Wsign-compare",
--
2.4.6

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From 03ebd530208718687f81f3fc8c943d25ba8c5ee2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <mnhu@prevas.dk>
Date: Thu, 3 Dec 2015 08:56:24 +0100
Subject: [PATCH] skip logging to startup_log at startup

When running from embedded devices without RTC, the startup logging
sometimes fails due to a time collision in startup_log. This is caused
by creating the index key from the system hostname appended with the
milliseconds since epoch, which in the embedded case is always approx.
the same.

Fix this by removing the logging at startup log.

startup_log:
https://docs.mongodb.org/manual/reference/local-database/#local.startup_log

upstream bug report:
https://jira.mongodb.org/browse/SERVER-21751
---
src/mongo/db/db.cpp | 45 ---------------------------------------------
1 file changed, 45 deletions(-)

diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 2b4ab0e..03735c1 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -198,49 +198,6 @@ public:
}
};

-static void logStartup() {
- BSONObjBuilder toLog;
- stringstream id;
- id << getHostNameCached() << "-" << jsTime().asInt64();
- toLog.append("_id", id.str());
- toLog.append("hostname", getHostNameCached());
-
- toLog.appendTimeT("startTime", time(0));
- toLog.append("startTimeLocal", dateToCtimeString(Date_t::now()));
-
- toLog.append("cmdLine", serverGlobalParams.parsedOpts);
- toLog.append("pid", ProcessId::getCurrent().asLongLong());
-
-
- BSONObjBuilder buildinfo(toLog.subobjStart("buildinfo"));
- appendBuildInfo(buildinfo);
- appendStorageEngineList(&buildinfo);
- buildinfo.doneFast();
-
- BSONObj o = toLog.obj();
-
- OperationContextImpl txn;
-
- ScopedTransaction transaction(&txn, MODE_X);
- Lock::GlobalWrite lk(txn.lockState());
- AutoGetOrCreateDb autoDb(&txn, "local", mongo::MODE_X);
- Database* db = autoDb.getDb();
- const std::string ns = "local.startup_log";
- Collection* collection = db->getCollection(ns);
- WriteUnitOfWork wunit(&txn);
- if (!collection) {
- BSONObj options = BSON("capped" << true << "size" << 10 * 1024 * 1024);
- bool shouldReplicateWrites = txn.writesAreReplicated();
- txn.setReplicatedWrites(false);
- ON_BLOCK_EXIT(&OperationContext::setReplicatedWrites, &txn, shouldReplicateWrites);
- uassertStatusOK(userCreateNS(&txn, db, ns, options));
- collection = db->getCollection(ns);
- }
- invariant(collection);
- uassertStatusOK(collection->insertDocument(&txn, o, false).getStatus());
- wunit.commit();
-}
-
static void checkForIdIndexes(OperationContext* txn, Database* db) {
if (db->name() == "local") {
// we do not need an _id index on anything in the local database
@@ -581,8 +538,6 @@ static void _initAndListen(int listenPort) {

PeriodicTask::startRunningPeriodicTasks();

- logStartup();
-
// MessageServer::run will return when exit code closes its socket
server->run();
}
--
2.6.2

Loading