0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

Do objcheck for single inserts outside of writelock. SERVER-3724

Fix for bulk inserts after 2.0
This commit is contained in:
Mathias Stearn 2011-08-31 11:14:51 -04:00
parent 640fc155cd
commit 8f2b751b77

View File

@ -604,7 +604,7 @@ namespace mongo {
}
if( !d.moreJSObjs() )
break;
js = d.nextJsObj();
js = d.nextJsObj(); // TODO: refactor to do objcheck outside of writelock
}
}
@ -613,6 +613,12 @@ namespace mongo {
const char *ns = d.getns();
op.debug().ns = ns;
if( !d.moreJSObjs() ) {
// strange. should we complain?
return;
}
BSONObj js = d.nextJsObj();
writelock lk(ns);
// writelock is used to synchronize stepdowns w/ writes
@ -623,11 +629,6 @@ namespace mongo {
Client::Context ctx(ns);
if( !d.moreJSObjs() ) {
// strange. should we complain?
return;
}
BSONObj js = d.nextJsObj();
if( d.moreJSObjs() ) {
insertMulti(d, ns, js);
return;