diff --git a/jstests/mmap_v1/capped2.js b/jstests/mmap_v1/capped2.js index 65bb82f4c07..3ecb6c219b0 100644 --- a/jstests/mmap_v1/capped2.js +++ b/jstests/mmap_v1/capped2.js @@ -48,13 +48,21 @@ function checkDecreasing( i ) { for( i = 0 ;; ++i ) { debug( "capped 2: " + i ); tzz.insert( val[ i ] ); - if ( tzz.count() == 0 ) { + var err = db.getLastError(); + if ( err ) { + debug(err); + debug(tzz.count()); assert( i > 100, "K" ); break; } checkIncreasing( i ); } +// drop and recreate. Test used to rely on the last insert emptying the collection, which it no +// longer does now that we rollback on failed inserts. +tzz.drop(); +db._dbCommand( { create: "capped2", capped: true, size: 1000, $nExtents: 11, autoIndexId: false } ); + for( i = 600 ; i >= 0 ; --i ) { debug( "capped 2: " + i ); tzz.insert( val[ i ] ); diff --git a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp index 83209a7fa9b..9443c01b284 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp @@ -39,7 +39,7 @@ #include "mongo/util/log.h" // Remove once we are ready to enable -#define ROLLBACK_ENABLED 0 +#define ROLLBACK_ENABLED 1 namespace mongo {