summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Becker <ben.becker@10gen.com>2012-04-19 00:34:59 -0700
committerAndy Schwerin <schwerin@10gen.com>2012-04-19 17:54:47 -0400
commit6245495caba8227f08741c8814bcfdc9a8869d25 (patch)
tree519a03e486cd4c320ea91a65f5de02b96364afce
parent264b914c4b19e3e6e094d49761e85e9555b49957 (diff)
downloadmongo-6245495caba8227f08741c8814bcfdc9a8869d25.tar.gz
SERVER-5645: release lock between upserts when applying bulk xfers
-rw-r--r--s/d_migrate.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/s/d_migrate.cpp b/s/d_migrate.cpp
index e24a02d3538..731761f2986 100644
--- a/s/d_migrate.cpp
+++ b/s/d_migrate.cpp
@@ -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 );