[SERVER-1544] blocking for replication returns success with no replication configured Created: 02/Aug/10  Updated: 12/Jul/16  Resolved: 02/Aug/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.4.4
Fix Version/s: 1.5.8

Type: Bug Priority: Major - P3
Reporter: Nick Leippe Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 10.04.1, x86-64


Operating System: ALL
Participants:

 Description   

> db.printReplicationInfo()
{
"errmsg" : "local.oplog.$main, or its options, not found in system.namespaces collection (not --master?)"
}

> db.printSlaveReplicationInfo()
local.sources is empty; is this db a --slave?

> coll.insert({})
> db.runCommand(

{ getlasterror: 1, w: 2, wtimeout: 3000 }

)

{ "err" : null, "n" : 0, "ok" : 1 }

The above should fail--it could not possibly have replicated to two servers since there is only one.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 13/Aug/10 ]

The case doesn't address the issue you're having at all.
The drivers throw an exception for "ok:0" which you can see in the shell as well.

Comment by Nick Leippe [ 13/Aug/10 ]

still having some problems with this:
server 1.6.0
client 1.6.0
pymongo 1.8.1

in the shell, I get the expected behavior:
> db.runCommand(

{ getlasterror: 1, w: 2, wtimeout: 3000 }

)
{
"err" : null,
"n" : 0,
"wtimeout" : true,
"waited" : 3000,
"errmsg" : "timed out waiting for slaves",
"ok" : 0
}

but from with this python code:
err = db.command("getlasterror",
w = 2, # replicate to at least one slave
wtimeout = 1000 * timeout_s
)

I still get:

File "build/bdist.linux-x86_64/egg/pymongo/database.py", line 294, in command
pymongo.errors.OperationFailure: command SON([('getlasterror', 1), ('wtimeout', 2000), ('w', 2)]) failed: timed out waiting for slaves

So, for some reason the driver is still raising an exception.

Comment by Nick Leippe [ 02/Aug/10 ]

just tested on 1.5.6, same behavior still exists.
not sure how to edit the bug to update the affected version

Generated at Thu Feb 08 02:57:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.