Permalink
Browse files

SERVER-5645: release lock between upserts when applying bulk xfers

  • Loading branch information...
1 parent 264b914 commit 6245495caba8227f08741c8814bcfdc9a8869d25 @vrtx vrtx committed with amschwerin Apr 19, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 s/d_migrate.cpp
View
@@ -1445,13 +1445,13 @@ namespace mongo {
bool didAnything = false;
if ( xfer["deleted"].isABSONObj() ) {
- writelock lk(ns);
- Client::Context cx(ns);
-
RemoveSaver rs( "moveChunk" , ns , "removedDuring" );
BSONObjIterator i( xfer["deleted"].Obj() );
while ( i.more() ) {
+ writelock lk(ns);
+ Client::Context cx(ns);
+
BSONObj id = i.next().Obj();
// do not apply deletes if they do not belong to the chunk being migrated
@@ -1472,11 +1472,11 @@ namespace mongo {
}
if ( xfer["reload"].isABSONObj() ) {
- writelock lk(ns);
- Client::Context cx(ns);
-
BSONObjIterator i( xfer["reload"].Obj() );
while ( i.more() ) {
+ writelock lk(ns);
+ Client::Context cx(ns);
+
BSONObj it = i.next().Obj();
Helpers::upsert( ns , it );

0 comments on commit 6245495

Please sign in to comment.