diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-08-03 11:26:39 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-08-03 11:26:39 -0400 |
commit | 625115721c13c93c2b17bab9bc0d686322fa9546 (patch) | |
tree | 8d254125ce781470229c39ff7ba87cd059f377bc /db | |
parent | fd10e8b430ee42cda42c5706440c6dffe2078a1f (diff) | |
download | mongo-625115721c13c93c2b17bab9bc0d686322fa9546.tar.gz |
fix rollback saving SERVER-1512
Diffstat (limited to 'db')
-rw-r--r-- | db/dbhelpers.cpp | 11 | ||||
-rw-r--r-- | db/repl/rs_rollback.cpp | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/db/dbhelpers.cpp b/db/dbhelpers.cpp index b94e523d73f..1545f26c85a 100644 --- a/db/dbhelpers.cpp +++ b/db/dbhelpers.cpp @@ -339,17 +339,20 @@ namespace mongo { } } - RemoveSaver::RemoveSaver( const string& type , const string& ns , const string& why) : _out(0){ + RemoveSaver::RemoveSaver( const string& a , const string& b , const string& why) : _out(0){ static int NUM = 0; _root = dbpath; - _root /= type; - _root /= ns; + if ( a.size() ) + _root /= a; + if ( b.size() ) + _root /= b; + assert( a.size() || b.size() ); _file = _root; stringstream ss; - ss << why << "." << terseCurrentTime() << "." << NUM++ << ".bson"; + ss << why << "." << terseCurrentTime(false) << "." << NUM++ << ".bson"; _file /= ss.str(); } diff --git a/db/repl/rs_rollback.cpp b/db/repl/rs_rollback.cpp index 7d708589ab3..ec373cde1a7 100644 --- a/db/repl/rs_rollback.cpp +++ b/db/repl/rs_rollback.cpp @@ -289,7 +289,7 @@ namespace mongo { shared_ptr<RemoveSaver>& rs = removeSavers[d.ns]; if ( ! rs ) - rs.reset( new RemoveSaver( "replSet" , "rollback" , d.ns ) ); + rs.reset( new RemoveSaver( "rollback" , "" , d.ns ) ); // todo: lots of overhead in context, this can be faster Client::Context c(d.ns, dbpath, 0, /*doauth*/false); |