summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-06-25 13:08:51 -0400
committerDwight <dmerriman@gmail.com>2008-06-25 13:08:51 -0400
commitdc3966299474e8bf468c48027b0f161c1364f8aa (patch)
tree9761050ad6621d66df8e47b00eb4fe748010f88f
parent24d5031c9b35ffea4601860f0320388b7b516324 (diff)
downloadmongo-dc3966299474e8bf468c48027b0f161c1364f8aa.tar.gz
capped: don't assert on what could be a user error
-rw-r--r--db/db.cpp4
-rw-r--r--db/pdfile.cpp7
2 files changed, 4 insertions, 7 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 6f9d101ea74..379c57c169a 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -430,7 +430,7 @@ struct OpLog {
string name = ss.str();
f = new ofstream(name.c_str(), ios::out | ios::binary);
if ( ! f->good() ){
- cerr << "couldn't open log stream" << endl;
+ problem() << "couldn't open log stream" << endl;
throw 1717;
}
}
@@ -665,10 +665,8 @@ void setupSignals() {}
#endif
void initAndListen(int listenPort, const char *dbPath, const char *appserverLoc = null) {
-
_oplog.init();
-
#if !defined(_WIN32)
assert( signal(SIGSEGV, segvhandler) != SIG_ERR );
#endif
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index e8ec7c6ee40..1daac07ff83 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -268,10 +268,9 @@ DiskLoc NamespaceDetails::_alloc(const char *ns, int len) {
DiskLoc fr = firstExtent.ext()->firstRecord;
if( fr.isNull() ) {
- cout << "couldn't make room for new record in capped ns\n";
- cout << " ns:" << ns;
- cout << "\n len: " << len << endl;
- assert(false);
+ cout << "couldn't make room for new record in capped ns " << ns
+ << " len: " << len << " extentsize:" << lastExtentSize << '\n';
+ assert( len * 5 > lastExtentSize ); // assume it is unusually large record; if not, something is broken
return DiskLoc();
}