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:
parent
640fc155cd
commit
8f2b751b77
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user