mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +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 ) {
|
while ( 1 ) {
|
||||||
OpTime op(c.getLastOp());
|
OpTime op(c.getLastOp());
|
||||||
|
|
||||||
if ( opReplicatedEnough( op, w ) )
|
|
||||||
break;
|
|
||||||
|
|
||||||
// if replication isn't enabled (e.g., config servers)
|
// if replication isn't enabled (e.g., config servers)
|
||||||
if ( ! anyReplEnabled() ) {
|
if ( ! anyReplEnabled() ) {
|
||||||
errmsg = "replication not enabled";
|
errmsg = "replication not enabled";
|
||||||
@ -171,6 +168,9 @@ namespace mongo {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( opReplicatedEnough( op, w ) )
|
||||||
|
break;
|
||||||
|
|
||||||
if ( timeout > 0 && t.millis() >= timeout ) {
|
if ( timeout > 0 && t.millis() >= timeout ) {
|
||||||
result.append( "wtimeout" , true );
|
result.append( "wtimeout" , true );
|
||||||
errmsg = "timed out waiting for slaves";
|
errmsg = "timed out waiting for slaves";
|
||||||
|
Loading…
Reference in New Issue
Block a user