Skip to content

Commit 5b9a7cf

Browse files
committed
Chunk Migrate - PageFaultRetryableSection for migrate insertion
1 parent 95cb7b9 commit 5b9a7cf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/mongo/s/d_migrate.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "../db/repl_block.h"
3939
#include "../db/dur.h"
4040
#include "../db/clientcursor.h"
41+
#include "../db/pagefault.h"
4142

4243
#include "../client/connpool.h"
4344
#include "../client/distlock.h"
@@ -1462,8 +1463,17 @@ namespace mongo {
14621463
while( i.more() ) {
14631464
BSONObj o = i.next().Obj();
14641465
{
1465-
Lock::DBWrite lk( ns );
1466-
Helpers::upsert( ns, o, true );
1466+
PageFaultRetryableSection pgrs;
1467+
while ( 1 ) {
1468+
try {
1469+
Lock::DBWrite lk( ns );
1470+
Helpers::upsert( ns, o, true );
1471+
break;
1472+
}
1473+
catch ( PageFaultException& e ) {
1474+
e.touch();
1475+
}
1476+
}
14671477
}
14681478
thisTime++;
14691479
numCloned++;

0 commit comments

Comments
 (0)