Compare commits
8 Commits
SERVER-569
...
r1.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e316c78bc3 | ||
|
|
1c04baf944 | ||
|
|
f40cd45c17 | ||
|
|
5049bce6a0 | ||
|
|
8c29986cf7 | ||
|
|
1a4490dbba | ||
|
|
afe21e02c1 | ||
|
|
dabf2ce546 |
@@ -1290,6 +1290,8 @@ def s3push( localName , remoteName=None , remotePrefix=None , fixName=True , pla
|
||||
remotePrefix = "-" + distName
|
||||
|
||||
sys.path.append( "." )
|
||||
sys.path.append( ".." )
|
||||
sys.path.append( "../../" )
|
||||
|
||||
import simples3
|
||||
import settings
|
||||
|
||||
@@ -134,6 +134,11 @@ namespace mongo {
|
||||
i != toAdvance.end(); ++i )
|
||||
{
|
||||
Cursor *c = (*i)->c.get();
|
||||
if ( c->capped() ){
|
||||
delete *i;
|
||||
continue;
|
||||
}
|
||||
|
||||
c->checkLocation();
|
||||
DiskLoc tmp1 = c->refLoc();
|
||||
if ( tmp1 != dl ) {
|
||||
|
||||
@@ -305,10 +305,9 @@ namespace mongo {
|
||||
MDFHeader *h = p->getHeader();
|
||||
if ( !h->currentVersion() ) {
|
||||
// QUESTION: Repair even if file format is higher version than code?
|
||||
log() << "repairing database " << dbName << " with pdfile version " << h->version << "." << h->versionMinor << ", "
|
||||
<< "new version: " << VERSION << "." << VERSION_MINOR << endl;
|
||||
string errmsg;
|
||||
assert( repairDatabase( dbName.c_str(), errmsg ) );
|
||||
log() << "can't migrate data version " << dbName << " with pdfile version " << h->version << "." << h->versionMinor << ", "
|
||||
<< "new version: " << VERSION << "." << VERSION_MINOR << endl;
|
||||
throw UserException( "wrong data file version" );
|
||||
} else {
|
||||
closeClient( dbName.c_str() );
|
||||
}
|
||||
|
||||
@@ -422,6 +422,7 @@ namespace mongo {
|
||||
// Last, in case we're killed before getting here
|
||||
capExtent = firstExtent;
|
||||
}
|
||||
assert( nIndexes <= 10 ); // make sure we aren't trying to use new index format with 1.0.x server
|
||||
}
|
||||
|
||||
/* alloc with capped table handling. */
|
||||
|
||||
@@ -907,9 +907,14 @@ namespace mongo {
|
||||
}
|
||||
|
||||
QueryResult* getMore(const char *ns, int ntoreturn, long long cursorid) {
|
||||
BufBuilder b(32768);
|
||||
|
||||
ClientCursor *cc = ClientCursor::find(cursorid);
|
||||
|
||||
int bufSize = 512;
|
||||
if ( cc ){
|
||||
bufSize += sizeof( QueryResult );
|
||||
bufSize += ( ntoreturn ? 4 : 1 ) * 1024 * 1024;
|
||||
}
|
||||
BufBuilder b( bufSize );
|
||||
|
||||
b.skip(sizeof(QueryResult));
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace mongo {
|
||||
bool questionable() {
|
||||
return ofs < -1 ||
|
||||
fileNo < -1 ||
|
||||
fileNo > 20;
|
||||
fileNo > 524288;
|
||||
}
|
||||
|
||||
bool isNull() const {
|
||||
|
||||
@@ -639,7 +639,91 @@ namespace QueryTests {
|
||||
ASSERT_EQUALS( 2U, client().count( ns, BSON( "foo.bar" << "spam" ) ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class DifferentNumbers : public ClientBase {
|
||||
public:
|
||||
~DifferentNumbers(){
|
||||
client().dropCollection( "unittests.querytests.DifferentNumbers" );
|
||||
}
|
||||
void t( const char * ns ){
|
||||
auto_ptr< DBClientCursor > cursor = client().query( ns, Query().sort( "7" ) );
|
||||
while ( cursor->more() ){
|
||||
BSONObj o = cursor->next();
|
||||
cout << " foo " << o << endl;
|
||||
}
|
||||
|
||||
}
|
||||
void run() {
|
||||
const char *ns = "unittests.querytests.DifferentNumbers";
|
||||
{ BSONObjBuilder b; b.append( "7" , (int)4 ); client().insert( ns , b.obj() ); }
|
||||
{ BSONObjBuilder b; b.append( "7" , (long long)2 ); client().insert( ns , b.obj() ); }
|
||||
{ BSONObjBuilder b; b.appendNull( "7" ); client().insert( ns , b.obj() ); }
|
||||
{ BSONObjBuilder b; b.append( "7" , "b" ); client().insert( ns , b.obj() ); }
|
||||
{ BSONObjBuilder b; b.appendNull( "8" ); client().insert( ns , b.obj() ); }
|
||||
{ BSONObjBuilder b; b.append( "7" , (double)3.7 ); client().insert( ns , b.obj() ); }
|
||||
|
||||
t(ns);
|
||||
client().ensureIndex( ns , BSON( "7" << 1 ) );
|
||||
t(ns);
|
||||
}
|
||||
};
|
||||
|
||||
class TailableCappedRaceCondition : public ClientBase {
|
||||
public:
|
||||
|
||||
TailableCappedRaceCondition(){
|
||||
client().dropCollection( ns() );
|
||||
_n = 0;
|
||||
}
|
||||
~TailableCappedRaceCondition(){
|
||||
client().dropCollection( ns() );
|
||||
}
|
||||
|
||||
int count(){
|
||||
return client().count( ns() );
|
||||
}
|
||||
|
||||
void run(){
|
||||
string err;
|
||||
ASSERT( userCreateNS( ns() , fromjson( "{ capped : true , size : 2000 }" ) , err , false ) );
|
||||
for ( int i=0; i<100; i++ ){
|
||||
insertNext();
|
||||
ASSERT( count() < 40 );
|
||||
}
|
||||
|
||||
int a = count();
|
||||
|
||||
auto_ptr< DBClientCursor > c = client().query( ns() , QUERY( "i" << GT << 0 ).hint( BSON( "$natural" << 1 ) ), 0, 0, 0, Option_CursorTailable );
|
||||
int n=0;
|
||||
while ( c->more() ){
|
||||
BSONObj z = c->next();
|
||||
n++;
|
||||
}
|
||||
|
||||
ASSERT_EQUALS( a , n );
|
||||
|
||||
insertNext();
|
||||
ASSERT( c->more() );
|
||||
|
||||
for ( int i=0; i<50; i++ ){
|
||||
insertNext();
|
||||
}
|
||||
|
||||
while ( c->more() ){ c->next(); }
|
||||
ASSERT( c->isDead() );
|
||||
}
|
||||
|
||||
const char * ns(){
|
||||
return "unittests.querytests.tailablecappedrace";
|
||||
}
|
||||
|
||||
void insertNext(){
|
||||
insert( ns() , BSON( "i" << _n++ ) );
|
||||
}
|
||||
|
||||
int _n;
|
||||
};
|
||||
|
||||
class All : public Suite {
|
||||
public:
|
||||
All() {
|
||||
@@ -674,6 +758,8 @@ namespace QueryTests {
|
||||
add< DirectLocking >();
|
||||
add< FastCountIn >();
|
||||
add< EmbeddedArray >();
|
||||
add< DifferentNumbers >();
|
||||
add< TailableCappedRaceCondition >();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = MongoDB
|
||||
PROJECT_NUMBER = 0.9.10
|
||||
PROJECT_NUMBER = 1.0.0
|
||||
OUTPUT_DIRECTORY = docs
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
@@ -33,6 +33,6 @@
|
||||
|
||||
namespace mongo {
|
||||
|
||||
const char versionString[] = "0.9.10";
|
||||
const char versionString[] = "1.0.1";
|
||||
|
||||
} // namespace mongo
|
||||
|
||||
Reference in New Issue
Block a user