summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <erh@ERH-OFC-MP.local>2009-10-22 10:51:16 -0400
committerEliot Horowitz <erh@ERH-OFC-MP.local>2009-10-22 10:51:16 -0400
commitf40cd45c178b9ae4be9f260127676ce38b776a72 (patch)
tree078bcef4727db4602b063fec035065ebf1ebea40
parent5049bce6a0455ffb962067a8ee9adb2138139fcb (diff)
downloadmongo-f40cd45c178b9ae4be9f260127676ce38b776a72.tar.gz
safety to ensure we don't use a new pdfiel version or something with > 10 indexes
-rw-r--r--db/db.cpp7
-rw-r--r--db/namespace.cpp1
2 files changed, 4 insertions, 4 deletions
diff --git a/db/db.cpp b/db/db.cpp
index efad0d2e41b..6466c4a74d8 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -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() );
}
diff --git a/db/namespace.cpp b/db/namespace.cpp
index 3e5cc497901..02bccd48566 100644
--- a/db/namespace.cpp
+++ b/db/namespace.cpp
@@ -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. */