mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
Move opReplicatedEnough call until after checking for errors
This commit is contained in:
parent
7324c1722a
commit
593d6a05b4
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user