Compare commits

...

8 Commits

Author SHA1 Message Date
Eliot Horowitz
e316c78bc3 removed 1 test that shouldn't have been merged 2009-10-22 11:22:10 -04:00
Eliot Horowitz
1c04baf944 version # 1.0.1 2009-10-22 10:54:24 -04:00
Eliot Horowitz
f40cd45c17 safety to ensure we don't use a new pdfiel version or something with > 10 indexes 2009-10-22 10:51:16 -04:00
Eliot Horowitz
5049bce6a0 fix bug with cursors and capped collections where cursor could get partial data
possible merge conflict
2009-10-20 09:53:03 -04:00
Eliot Horowitz
8c29986cf7 make getMore buffer big since we know there are lots of results 2009-10-19 17:38:45 -04:00
Eliot Horowitz
1a4490dbba validate() says invalid if more than 20 files SERVER-269 2009-08-28 10:17:32 -04:00
Eliot Horowitz
afe21e02c1 look for settings.py backwards a bit 2009-08-27 11:53:01 -04:00
Eliot Horowitz
dabf2ce546 1.0.0 marker 2009-08-27 09:46:00 -04:00
9 changed files with 108 additions and 10 deletions

View File

@@ -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

View File

@@ -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 ) {

View File

@@ -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() );
}

View File

@@ -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. */

View File

@@ -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));

View File

@@ -55,7 +55,7 @@ namespace mongo {
bool questionable() {
return ofs < -1 ||
fileNo < -1 ||
fileNo > 20;
fileNo > 524288;
}
bool isNull() const {

View File

@@ -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 >();
}
};

View File

@@ -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

View File

@@ -33,6 +33,6 @@
namespace mongo {
const char versionString[] = "0.9.10";
const char versionString[] = "1.0.1";
} // namespace mongo