diff options
author | Dwight <dwight@10gen.com> | 2011-04-18 12:37:40 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2011-04-18 12:37:40 -0400 |
commit | e749ff2ff61748480c35abe7a4f80eb6f28f187a (patch) | |
tree | 9feede24474822354ff3617078282e00a826fce7 /db | |
parent | 94f581c1a1d274224e137b32fc46e69eab823c57 (diff) | |
parent | 982fb4e66f54b29d30dbd4d0ba30cc652c300c1d (diff) | |
download | mongo-e749ff2ff61748480c35abe7a4f80eb6f28f187a.tar.gz |
Merge branch 'master' of github.com:mongodb/mongo
Diffstat (limited to 'db')
-rw-r--r-- | db/cloner.cpp | 7 | ||||
-rw-r--r-- | db/mongommf.cpp | 2 | ||||
-rw-r--r-- | db/pdfile.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/db/cloner.cpp b/db/cloner.cpp index fd86e10b787..74a22659909 100644 --- a/db/cloner.cpp +++ b/db/cloner.cpp @@ -62,6 +62,8 @@ namespace mongo { for example repairDatabase need not use it. */ void setConnection( DBClientWithCommands *c ) { conn.reset( c ); } + + /** copy the entire database */ bool go(const char *masterHost, string& errmsg, const string& fromdb, bool logForRepl, bool slaveOk, bool useReplAuth, bool snapshot, bool mayYield, bool mayBeInterrupted, int *errCode = 0); bool copyCollection( const string& from , const string& ns , const BSONObj& query , string& errmsg , bool mayYield, bool mayBeInterrupted, bool copyIndexes = true, bool logForRepl = true ); @@ -564,9 +566,10 @@ namespace mongo { virtual LockType locktype() const { return WRITE; } virtual void help( stringstream &help ) const { help << "copy a database from another host to this host\n"; - help << "usage: {copydb: 1, fromhost: <hostname>, fromdb: <db>, todb: <db>[, username: <username>, nonce: <nonce>, key: <key>]}"; + help << "usage: {copydb: 1, fromhost: <hostname>, fromdb: <db>, todb: <db>[, slaveOk: <bool>, username: <username>, nonce: <nonce>, key: <key>]}"; } virtual bool run(const string& dbname, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + bool slaveOk = cmdObj["slaveOk"].trueValue(); string fromhost = cmdObj.getStringField("fromhost"); if ( fromhost.empty() ) { /* copy from self */ @@ -597,7 +600,7 @@ namespace mongo { c.setConnection( authConn_.release() ); } Client::Context ctx(todb); - bool res = c.go(fromhost.c_str(), errmsg, fromdb, /*logForReplication=*/!fromRepl, /*slaveok*/false, /*replauth*/false, /*snapshot*/true, /*mayYield*/true, /*mayBeInterrupted*/ false); + bool res = c.go(fromhost.c_str(), errmsg, fromdb, /*logForReplication=*/!fromRepl, slaveOk, /*replauth*/false, /*snapshot*/true, /*mayYield*/true, /*mayBeInterrupted*/ false); return res; } } cmdcopydb; diff --git a/db/mongommf.cpp b/db/mongommf.cpp index f165baf55b6..70410e9ee2a 100644 --- a/db/mongommf.cpp +++ b/db/mongommf.cpp @@ -101,7 +101,7 @@ namespace mongo { #if 1 // https://jira.mongodb.org/browse/SERVER-2942 DWORD old; - bool ok = VirtualProtect(oldPrivateAddr, len, PAGE_READONLY, &old); + bool ok = VirtualProtect(oldPrivateAddr, (SIZE_T) len, PAGE_READONLY, &old); if( !ok ) { DWORD e = GetLastError(); log() << "VirtualProtect failed in remapPrivateView " << filename() << hex << oldPrivateAddr << ' ' << len << ' ' << errnoWithDescription(e) << endl; diff --git a/db/pdfile.cpp b/db/pdfile.cpp index 2533ebb5798..8828a8853e7 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -2051,7 +2051,7 @@ namespace mongo { bool ok = false; BOOST_CHECK_EXCEPTION( ok = fo.apply( q ) ); if ( ok ) - log(2) << fo.op() << " file " << q.string() << '\n'; + log(2) << fo.op() << " file " << q.string() << endl; int i = 0; int extra = 10; // should not be necessary, this is defensive in case there are missing files while ( 1 ) { |