Skip to content

Commit 31bb33c

Browse files
author
Brandon Diamond
committed
SERVER-3937: Only call GLE if w > 1
1 parent f143152 commit 31bb33c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/restore.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ class Restore : public BSONTool {
258258
conn().runCommand(db, cmd, out);
259259

260260
// wait for ops to propagate to "w" nodes (doesn't warn if w used without replset)
261-
conn().getLastError(false, false, _w);
261+
if ( w > 1 ) {
262+
conn().getLastError(false, false, _w);
263+
}
262264
}
263265
else if ( endsWith( _curns.c_str() , ".system.indexes" )) {
264266
/* Index construction is slightly special: when restoring
@@ -308,7 +310,9 @@ class Restore : public BSONTool {
308310
conn().insert( _curns , obj );
309311

310312
// wait for insert to propagate to "w" nodes (doesn't warn if w used without replset)
311-
conn().getLastErrorDetailed(false, false, _w);
313+
if ( _w > 1 ) {
314+
conn().getLastErrorDetailed(false, false, _w);
315+
}
312316
}
313317
}
314318

0 commit comments

Comments
 (0)