Skip to content
Browse files

fix spinlock deadlock

  • Loading branch information...
1 parent c775f5f commit 453a586af67dab0d1886184c7cca01b0a3d01926 @erh erh committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 s/d_migrate.cpp
View
8 s/d_migrate.cpp
@@ -453,8 +453,6 @@ namespace mongo {
maxRecsWhenFull = numeric_limits<long long>::max();
}
- scoped_spinlock lk( _trackerLocks );
-
// do a full traversal of the chunk and don't stop even if we think it is a large chunk
// we want the number of records to better report, in that case
bool isLargeChunk = false;
@@ -462,6 +460,7 @@ namespace mongo {
while ( cc->ok() ) {
DiskLoc dl = cc->currLoc();
if ( ! isLargeChunk ) {
+ scoped_spinlock lk( _trackerLocks );
_cloneLocs.insert( dl );
}
cc->advance();
@@ -489,7 +488,10 @@ namespace mongo {
return false;
}
- log() << "moveChunk number of documents: " << _cloneLocs.size() << migrateLog;
+ {
+ scoped_spinlock lk( _trackerLocks );
+ log() << "moveChunk number of documents: " << _cloneLocs.size() << migrateLog;
+ }
return true;
}

0 comments on commit 453a586

Please sign in to comment.
Something went wrong with that request. Please try again.