diff options
author | Mathias Stearn <redbeard0531@gmail.com> | 2011-01-17 21:31:48 -0500 |
---|---|---|
committer | Mathias Stearn <redbeard0531@gmail.com> | 2011-01-17 23:00:19 -0500 |
commit | 593d6a05b46caf77c92219f9b51cecec6fa5e9fc (patch) | |
tree | 71cf9ee1e0f31e23ec7f089cb496c7d487c238e5 /db/dbcommands.cpp | |
parent | 7324c1722acb4da5c3abc355c8206ecad11ae093 (diff) | |
download | mongo-593d6a05b46caf77c92219f9b51cecec6fa5e9fc.tar.gz |
Move opReplicatedEnough call until after checking for errors
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r-- | db/dbcommands.cpp | 6 |
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"; |