summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorMathias Stearn <redbeard0531@gmail.com>2011-01-17 21:31:48 -0500
committerMathias Stearn <redbeard0531@gmail.com>2011-01-17 23:00:19 -0500
commit593d6a05b46caf77c92219f9b51cecec6fa5e9fc (patch)
tree71cf9ee1e0f31e23ec7f089cb496c7d487c238e5 /db/dbcommands.cpp
parent7324c1722acb4da5c3abc355c8206ecad11ae093 (diff)
downloadmongo-593d6a05b46caf77c92219f9b51cecec6fa5e9fc.tar.gz
Move opReplicatedEnough call until after checking for errors
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index ee90d38ce65..b4b3d463ce4 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -156,9 +156,6 @@ namespace mongo {
while ( 1 ) {
OpTime op(c.getLastOp());
- if ( opReplicatedEnough( op, w ) )
- break;
-
// if replication isn't enabled (e.g., config servers)
if ( ! anyReplEnabled() ) {
errmsg = "replication not enabled";
@@ -171,6 +168,9 @@ namespace mongo {
return true;
}
+ if ( opReplicatedEnough( op, w ) )
+ break;
+
if ( timeout > 0 && t.millis() >= timeout ) {
result.append( "wtimeout" , true );
errmsg = "timed out waiting for slaves";