mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
Merge branch 'master' of github.com:mongodb/mongo
This commit is contained in:
commit
43554f2403
24
SConstruct
24
SConstruct
@ -590,9 +590,10 @@ elif "win32" == os.sys.platform:
|
|||||||
|
|
||||||
boostLibs = []
|
boostLibs = []
|
||||||
|
|
||||||
env.Append( CPPPATH=[ "js/src/" ] )
|
env.Append(CPPPATH=[ "js/src/" ])
|
||||||
env.Append(CPPPATH=["../js/src/"])
|
env.Append(CPPPATH=["../js/src/"])
|
||||||
env.Append(LIBPATH=["../js/src"])
|
env.Append(LIBPATH=["../js/src"])
|
||||||
|
env.Append(LIBPATH=["../js/"])
|
||||||
env.Append( CPPDEFINES=[ "OLDJS" ] )
|
env.Append( CPPDEFINES=[ "OLDJS" ] )
|
||||||
|
|
||||||
winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] ,
|
winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] ,
|
||||||
@ -621,6 +622,7 @@ elif "win32" == os.sys.platform:
|
|||||||
env.Append( CPPFLAGS= " /O2 /MT /Gy /Zi /TP /errorReport:none " )
|
env.Append( CPPFLAGS= " /O2 /MT /Gy /Zi /TP /errorReport:none " )
|
||||||
# TODO: this has caused some linking problems :
|
# TODO: this has caused some linking problems :
|
||||||
# /GL whole program optimization
|
# /GL whole program optimization
|
||||||
|
# /LTCG link time code generation
|
||||||
env.Append( CPPFLAGS= " /GL " )
|
env.Append( CPPFLAGS= " /GL " )
|
||||||
env.Append( LINKFLAGS=" /LTCG " )
|
env.Append( LINKFLAGS=" /LTCG " )
|
||||||
else:
|
else:
|
||||||
@ -631,7 +633,7 @@ elif "win32" == os.sys.platform:
|
|||||||
# RTC1 /GZ (Enable Stack Frame Run-Time Error Checking)
|
# RTC1 /GZ (Enable Stack Frame Run-Time Error Checking)
|
||||||
env.Append( CPPFLAGS=" /Od /RTC1 /MDd /Zi /TP /errorReport:none " )
|
env.Append( CPPFLAGS=" /Od /RTC1 /MDd /Zi /TP /errorReport:none " )
|
||||||
env.Append( CPPFLAGS=' /Fd"mongod.pdb" ' )
|
env.Append( CPPFLAGS=' /Fd"mongod.pdb" ' )
|
||||||
env.Append( LINKFLAGS=" /incremental:yes /debug " )
|
env.Append( LINKFLAGS=" /debug " )
|
||||||
|
|
||||||
if force64 and os.path.exists( boostDir + "/lib/vs2010_64" ):
|
if force64 and os.path.exists( boostDir + "/lib/vs2010_64" ):
|
||||||
env.Append( LIBPATH=[ boostDir + "/lib/vs2010_64" ] )
|
env.Append( LIBPATH=[ boostDir + "/lib/vs2010_64" ] )
|
||||||
@ -642,7 +644,7 @@ elif "win32" == os.sys.platform:
|
|||||||
|
|
||||||
if force64:
|
if force64:
|
||||||
env.Append( LIBPATH=[ winSDKHome + "/Lib/x64" ] )
|
env.Append( LIBPATH=[ winSDKHome + "/Lib/x64" ] )
|
||||||
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
|
#env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
|
||||||
else:
|
else:
|
||||||
env.Append( LIBPATH=[ winSDKHome + "/Lib" ] )
|
env.Append( LIBPATH=[ winSDKHome + "/Lib" ] )
|
||||||
|
|
||||||
@ -669,7 +671,10 @@ elif "win32" == os.sys.platform:
|
|||||||
winLibString = "ws2_32.lib kernel32.lib advapi32.lib Psapi.lib"
|
winLibString = "ws2_32.lib kernel32.lib advapi32.lib Psapi.lib"
|
||||||
|
|
||||||
if force64:
|
if force64:
|
||||||
winLibString += " LIBCMT LIBCPMT "
|
|
||||||
|
winLibString += ""
|
||||||
|
#winLibString += " LIBCMT LIBCPMT "
|
||||||
|
|
||||||
else:
|
else:
|
||||||
winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib "
|
winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib "
|
||||||
winLibString += " odbc32.lib odbccp32.lib uuid.lib "
|
winLibString += " odbc32.lib odbccp32.lib uuid.lib "
|
||||||
@ -930,7 +935,16 @@ def doConfigure( myenv , needPcre=True , shell=False ):
|
|||||||
|
|
||||||
if usesm:
|
if usesm:
|
||||||
|
|
||||||
myCheckLib( [ "mozjs" , "js", "js_static" ] , True )
|
# see http://www.mongodb.org/pages/viewpageattachments.action?pageId=12157032
|
||||||
|
J = [ "mozjs" , "js", "js_static" ]
|
||||||
|
if windows and msarch == "amd64":
|
||||||
|
if release:
|
||||||
|
J = [ "js64r", "js", "mozjs" , "js_static" ]
|
||||||
|
else:
|
||||||
|
J = "js64d"
|
||||||
|
print( "will use js64d.lib for spidermonkey. (available at mongodb.org prebuilt.)" );
|
||||||
|
|
||||||
|
myCheckLib( J , True )
|
||||||
mozHeader = "js"
|
mozHeader = "js"
|
||||||
if bigLibString(myenv).find( "mozjs" ) >= 0:
|
if bigLibString(myenv).find( "mozjs" ) >= 0:
|
||||||
mozHeader = "mozjs"
|
mozHeader = "mozjs"
|
||||||
|
@ -14,7 +14,7 @@ def shouldKill( c ):
|
|||||||
if c.find( cwd ) >= 0:
|
if c.find( cwd ) >= 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if c.find( "buildbot" ) >= 0 and c.find( "/mongo/" ) >= 0:
|
if ( c.find( "buildbot" ) >= 0 or c.find( "slave" ) ) and c.find( "/mongo/" ) >= 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -119,7 +119,11 @@ namespace mongo {
|
|||||||
arrElt = e;
|
arrElt = e;
|
||||||
}
|
}
|
||||||
// enforce single array path here
|
// enforce single array path here
|
||||||
uassert( 10088 , "cannot index parallel arrays", e.type() != Array || e.rawdata() == arrElt.rawdata() );
|
if ( e.type() == Array && e.rawdata() != arrElt.rawdata() ){
|
||||||
|
stringstream ss;
|
||||||
|
ss << "cannot index parallel arrays [" << e.fieldName() << "] [" << arrElt.fieldName() << "]";
|
||||||
|
uasserted( 10088 , ss.str() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allFound = true; // have we found elements for all field names in the key spec?
|
bool allFound = true; // have we found elements for all field names in the key spec?
|
||||||
|
@ -218,7 +218,7 @@ namespace mongo {
|
|||||||
BSONObj o = fromjson("{\"initialsynccomplete\":1}");
|
BSONObj o = fromjson("{\"initialsynccomplete\":1}");
|
||||||
Helpers::putSingleton("local.pair.sync", o);
|
Helpers::putSingleton("local.pair.sync", o);
|
||||||
initialsynccomplete = 1;
|
initialsynccomplete = 1;
|
||||||
log() << "pair: initial sync complete" << endl;
|
tlog() << "pair: initial sync complete" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setInitialSyncCompletedLocking() {
|
void setInitialSyncCompletedLocking() {
|
||||||
|
@ -6,7 +6,7 @@ dbpath = "/data/db/" + baseDir + "/";
|
|||||||
var m = startMongod( "--directoryperdb", "--port", port, "--dbpath", dbpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
|
var m = startMongod( "--directoryperdb", "--port", port, "--dbpath", dbpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
|
||||||
db = m.getDB( baseName );
|
db = m.getDB( baseName );
|
||||||
db[ baseName ].save( {} );
|
db[ baseName ].save( {} );
|
||||||
assert.eq( 1, db[ baseName ].count() , "A" );
|
assert.eq( 1, db[ baseName ].count() , "A : " + tojson( db[baseName].find().toArray() ) );
|
||||||
|
|
||||||
checkDir = function( dir ) {
|
checkDir = function( dir ) {
|
||||||
db.runCommand( {fsync:1} );
|
db.runCommand( {fsync:1} );
|
||||||
|
12
pch.h
12
pch.h
@ -20,6 +20,18 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(MONGO_EXPOSE_MACROS)
|
||||||
|
#define JS_C_STRINGS_ARE_UTF8
|
||||||
|
#undef _UNICODE
|
||||||
|
#define _UNICODE
|
||||||
|
#undef UNICODE
|
||||||
|
#define UNICODE
|
||||||
|
#undef SUPPORT_UCP
|
||||||
|
#define SUPPORT_UCP
|
||||||
|
#undef SUPPORT_UTF8
|
||||||
|
#define SUPPORT_UTF8
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# define NOMINMAX
|
# define NOMINMAX
|
||||||
# include <winsock2.h> //this must be included before the first windows.h include
|
# include <winsock2.h> //this must be included before the first windows.h include
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "jstypes.h"
|
#include "jstypes.h"
|
||||||
#undef JS_PUBLIC_API
|
#undef JS_PUBLIC_API
|
||||||
#undef JS_PUBLIC_DATA
|
#undef JS_PUBLIC_DATA
|
||||||
#define JS_PUBLIC_API(t) t
|
#define JS_PUBLIC_API(t) t __cdecl
|
||||||
#define JS_PUBLIC_DATA(t) t
|
#define JS_PUBLIC_DATA(t) t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -224,10 +224,12 @@ public:
|
|||||||
ProgressMeter pm( fileSize );
|
ProgressMeter pm( fileSize );
|
||||||
const int BUF_SIZE = 1024 * 1024 * 4;
|
const int BUF_SIZE = 1024 * 1024 * 4;
|
||||||
boost::scoped_array<char> line(new char[BUF_SIZE+2]);
|
boost::scoped_array<char> line(new char[BUF_SIZE+2]);
|
||||||
while ( *in ){
|
while ( in->rdstate() == 0 ){
|
||||||
char * buf = line.get();
|
char * buf = line.get();
|
||||||
in->getline( buf , BUF_SIZE );
|
in->getline( buf , BUF_SIZE );
|
||||||
uassert( 10263 , "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 );
|
uassert( 10263 , "unknown error reading file" ,
|
||||||
|
(!(in->rdstate() & ios_base::badbit)) &&
|
||||||
|
(!(in->rdstate() & ios_base::failbit) || (in->rdstate() & ios_base::eofbit)) );
|
||||||
log(1) << "got line:" << buf << endl;
|
log(1) << "got line:" << buf << endl;
|
||||||
|
|
||||||
while( isspace( buf[0] ) ) buf++;
|
while( isspace( buf[0] ) ) buf++;
|
||||||
@ -238,10 +240,6 @@ public:
|
|||||||
|
|
||||||
buf[len+1] = 0;
|
buf[len+1] = 0;
|
||||||
|
|
||||||
if ( in->rdstate() == ios_base::eofbit )
|
|
||||||
break;
|
|
||||||
assert( in->rdstate() == 0 );
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BSONObj o = parseLine( buf );
|
BSONObj o = parseLine( buf );
|
||||||
if ( _headerLine ){
|
if ( _headerLine ){
|
||||||
|
@ -136,7 +136,6 @@ namespace mongo {
|
|||||||
ss << setw(width) << val << " ";
|
ss << setw(width) << val << " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string doRow( const BSONObj& a , const BSONObj& b ){
|
string doRow( const BSONObj& a , const BSONObj& b ){
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
|
|
||||||
@ -150,7 +149,14 @@ namespace mongo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( b.getFieldDotted("mem.supported").trueValue() ){
|
if ( b["backgroundFlushing"].type() == Object ){
|
||||||
|
BSONObj ax = a["backgroundFlushing"].embeddedObject();
|
||||||
|
BSONObj bx = b["backgroundFlushing"].embeddedObject();
|
||||||
|
BSONObjIterator i( bx );
|
||||||
|
cell( ss , "flushes/s" , 6 , (int)diff( "flushes" , ax , bx ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( b.getFieldDotted("mem.supported").trueValue() ){
|
||||||
BSONObj bx = b["mem"].embeddedObject();
|
BSONObj bx = b["mem"].embeddedObject();
|
||||||
BSONObjIterator i( bx );
|
BSONObjIterator i( bx );
|
||||||
cell( ss , "mapped" , 6 , bx["mapped"].numberInt() );
|
cell( ss , "mapped" , 6 , bx["mapped"].numberInt() );
|
||||||
|
@ -111,11 +111,14 @@ namespace mongo {
|
|||||||
|
|
||||||
SERVICE_STATUS serviceStatus;
|
SERVICE_STATUS serviceStatus;
|
||||||
|
|
||||||
// stop service if running
|
// stop service if its running
|
||||||
if ( ::ControlService( schService, SERVICE_CONTROL_STOP, &serviceStatus ) ) {
|
if ( ::ControlService( schService, SERVICE_CONTROL_STOP, &serviceStatus ) ) {
|
||||||
while ( ::QueryServiceStatus( schService, &serviceStatus ) ) {
|
while ( ::QueryServiceStatus( schService, &serviceStatus ) ) {
|
||||||
if ( serviceStatus.dwCurrentState == SERVICE_STOP_PENDING )
|
if ( serviceStatus.dwCurrentState == SERVICE_STOP_PENDING )
|
||||||
Sleep( 1000 );
|
{
|
||||||
|
Sleep( 1000 );
|
||||||
|
}
|
||||||
|
else { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,10 +62,6 @@ namespace mongo {
|
|||||||
//
|
//
|
||||||
|
|
||||||
void show_32_warning(){
|
void show_32_warning(){
|
||||||
#if BOOST_VERSION < 103500
|
|
||||||
cout << "\nwarning: built with boost version <= 1.34, limited concurrency" << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const char * foo = strchr( versionString , '.' ) + 1;
|
const char * foo = strchr( versionString , '.' ) + 1;
|
||||||
int bar = atoi( foo );
|
int bar = atoi( foo );
|
||||||
|
Loading…
Reference in New Issue
Block a user