mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
if you do w=2 with no write, should just return ok
This commit is contained in:
parent
fd1addeab9
commit
c400248eb9
@ -156,6 +156,11 @@ namespace mongo {
|
|||||||
while ( 1 ) {
|
while ( 1 ) {
|
||||||
OpTime op(c.getLastOp());
|
OpTime op(c.getLastOp());
|
||||||
|
|
||||||
|
if ( op.isNull() ) {
|
||||||
|
result.append( "wnote" , "no write has been done on this connection" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// check this first for w=0 or w=1
|
// check this first for w=0 or w=1
|
||||||
if ( opReplicatedEnough( op, w ) )
|
if ( opReplicatedEnough( op, w ) )
|
||||||
break;
|
break;
|
||||||
@ -167,10 +172,6 @@ namespace mongo {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( op.isNull() ) {
|
|
||||||
result.append( "err" , "no write has been done on this connection" );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( timeout > 0 && t.millis() >= timeout ) {
|
if ( timeout > 0 && t.millis() >= timeout ) {
|
||||||
result.append( "wtimeout" , true );
|
result.append( "wtimeout" , true );
|
||||||
|
Loading…
Reference in New Issue
Block a user