[SERVER-1580] Got cursor assertion error while calling find() in a replica set shard environment Created: 06/Aug/10  Updated: 12/Jul/16  Resolved: 17/Aug/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 1.6.0
Fix Version/s: 1.6.1, 1.7.0

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

Issue Links:
Depends
depends on SERVER-1584 sharding + rs issue on getMore Closed
Operating System: Linux
Participants:

 Description   

I built up a system in this way
1 replica set shard with 3 nodes
3 config server
1 mongos

/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1a --port 20001 --rest --shardsvr --replSet set1/172.16.1.193:20002
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1b --port 20002 --rest --shardsvr --replSet set1/172.16.1.193:20001
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1c --port 20003 --rest --shardsvr --replSet set1/172.16.1.193:20001
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf1 --port 30001 --rest --configsvr
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf2 --port 30002 --rest --configsvr
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf3 --port 30003 --rest --configsvr

echo 'cfg = {_id: "set1", members:[{_id: 0, host:"172.16.1.193:20001"},{_id: 1, host:"172.16.1.193:20002"}, {_id: 2, host: "172.16.1.193:20003"}]}; rs.initiate(cfg);' | /opt/mongodb/bin/mongo 172.16.1.193:20001

/opt/mongodb/bin/mongos --configdb 172.16.1.193:30001,172.16.1.193:30002,172.16.1.193:30003

echo 'db.runCommand(

{"addshard": "set1/172.16.1.193:20001,172.16.1.193:20002,172.16.1.193:20003"}

)' | /opt/mongodb/bin/mongo admin

Then I do following operations:
1. shard a database "mytest"
2. shard its collection "mycoll" by _id
3. insert one record
4. find the record and get 'error:

{ "$err" : "assertion client/dbclientcursor.cpp:204", "code" : 0 }

'



 Comments   
Comment by Che-Ching Wu [ 10/Aug/10 ]

It works fine now on build 2010-08-09. Thanks~

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

Ok - that makes more sense.
Would love if you could try tomorrow or next week with ngihtly

Comment by Che-Ching Wu [ 07/Aug/10 ]

Sorry, the error I got is on line 196. I also tested v1.5.8. Line number 204 is from v1.5.8. They are the same issue. Really sorry for incomplete information.

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

The issue at line 196 is fixed in master and the v1.6 branch and will be in both nightlies tomorrow
Its the :204 one i can't reproduce

Comment by Van Nguyen (vnguyen) [ 06/Aug/10 ]

I'm also getting this issue but for line 196.

This was my mongos log (hopefully it sheds some light):

Fri Aug 6 17:33:41 [conn26] Request::process ns: metamoki.users msg id:1756924432 attempt: 0
Fri Aug 6 17:33:41 [conn26] shard query: metamoki.users {}
Fri Aug 6 17:33:41 [conn26] shard query servers: 1
server:chronotrigger/crono:10000,crono:10001,lucca:30000 _extra:{} _orderObject:{}
cursor type: SerialServer
Fri Aug 6 17:33:41 [conn26] have to set shard version for conn: 0x85ba0b8 ns:metamoki.users my last seq: 0 current: 3 version: 1|0 manager: 0x85ce1f0
Fri Aug 6 17:33:41 [conn26] setShardVersion shard0001 chronotrigger/crono:10000,crono:10001,lucca:30000 metamoki.users

{ setShardVersion: "metamoki.users", configdb: "10.254.175.16:20000", version: Timestamp 1000|0, serverID: ObjectId('4c5bb3969eae351528437f34'), shard: "shard0001", shardHost: "chronotrigger/crono:10000,crono:10001,lucca:30000" }

0x85ba0b8
Fri Aug 6 17:33:41 [conn26] setShardVersion success!
Fri Aug 6 17:33:41 [conn26] ns: metamoki.users ClusteredCursor::query ShardConnection had to change attempt: 0
Fri Aug 6 17:33:41 [conn26] Request::process ns: metamoki.users msg id:1756924432 attempt: 1
Fri Aug 6 17:33:41 [conn26] shard query: metamoki.users {}
Fri Aug 6 17:33:41 [conn26] shard query servers: 1
server:chronotrigger/crono:10000,crono:10001,lucca:30000 _extra:{} _orderObject:{}
cursor type: SerialServer
Fri Aug 6 17:33:41 [conn26] ClusteredCursor::query (SerialServer) server:chronotrigger/crono:10000,crono:10001,lucca:30000 ns:metamoki.users query:{} num:0 _fields:{} options: 0
Fri Aug 6 17:33:41 [conn26] Assertion failure connector == conn->get() client/dbclientcursor.cpp 196
Fri Aug 6 17:33:41 [conn26] ~ScopedDBConnection: _conn != null
Fri Aug 6 17:33:41 [conn26] UserException: assertion client/dbclientcursor.cpp:196

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

I can't reproduce this exact error - though I fixed a similar one.
Can you attach the full mongos log?

Comment by Che-Ching Wu [ 06/Aug/10 ]

but count() works well.

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