Recently, I built a testing box because we thought the problem might
manifest only under heavy load.
Here's the setup I'm using:
* Ubuntu 10.04 LTS (Lucid Lynx)
* MongoDB 2.0.2 from the 10gen apt repository.
* Two replica sets consisting of two replicas and an arbiter. These two
sets are shards in the database.
* --keyAuth is enabled. (This is the reason we want to upgrade to 2.0.)
* For testing, the shard server has been configured with a small chunk size.
I created 10,000,000 dummy documents in the sharded collection and
attempted to
run a Map-Reduce. It eventually failed with this error:
pymongo.errors.OperationFailure: command SON([('mapreduce', u'phrases'),
('map', "function () { var a = this.phrase.split(' '); for (var i = 0; i
< a.length; ++i) { emit(a[i], 1); } }"), ('reduce', 'function (k, v) { t
= 0; for(var i = 0; i < v.length; ++i) { t += v[i]; } return t; }'),
('out', 'word_counts')]) failed: mongod mr failed: { assertion:
"assertion db/commands/../../util/net/../../db/../bson/bson-inl.h:184",
errmsg: "db assertion failure", ok: 0.0 }
Here are selected lines from mongos.log. I can send the full logs
off-list to
anyone who is interested.
Tue Feb 7 09:23:11 [conn2] authenticate: { authenticate: 1, nonce:
"e4b51fb3d5abd571", user: "mars", key: "201f1b95aba070bf9a323b9bb2b86614" }
Tue Feb 7 09:23:11 [conn2] initializing shard connection to cid:27018
Tue Feb 7 09:23:11 [conn2] initializing shard connection to cid:27021
Tue Feb 7 09:23:11 [conn2] setShardVersion shard1 cid:27018
test.phrases { setShardVersion: "test.phrases", configdb:
"cid:27023,cid:27024,cid:27025", version: Timestamp 10000|17, serverID:
ObjectId('4f31332942c5c1373aa9c862'), shard: "shard1", shardHost:
"shard1/cid:27017,cid:27018" } 0x15c9c60
Tue Feb 7 09:23:11 [conn2] setShardVersion failed!
Tue Feb 7 09:23:11 [conn2] setShardVersion shard1 cid:27018
test.phrases { setShardVersion: "test.phrases", configdb:
"cid:27023,cid:27024,cid:27025", version: Timestamp 10000|17, serverID:
ObjectId('4f31332942c5c1373aa9c862'), authoritative: true, shard:
"shard1", shardHost: "shard1/cid:27017,cid:27018" } 0x15c9c60
Tue Feb 7 09:23:11 [conn2] setShardVersion success: { oldVersion:
Timestamp 0|0, ok: 1.0 }
Tue Feb 7 09:23:11 [conn2] setShardVersion shard2 cid:27021
test.phrases { setShardVersion: "test.phrases", configdb:
"cid:27023,cid:27024,cid:27025", version: Timestamp 10000|21, serverID:
ObjectId('4f31332942c5c1373aa9c862'), shard: "shard2", shardHost:
"shard2/cid:27020,cid:27021" } 0x15c9fa0
Tue Feb 7 09:23:11 [conn2] setShardVersion failed!
Tue Feb 7 09:23:11 [conn2] setShardVersion shard2 cid:27021
test.phrases { setShardVersion: "test.phrases", configdb:
"cid:27023,cid:27024,cid:27025", version: Timestamp 10000|21, serverID:
ObjectId('4f31332942c5c1373aa9c862'), authoritative: true, shard:
"shard2", shardHost: "shard2/cid:27020,cid:27021" } 0x15c9fa0
Tue Feb 7 09:23:11 [conn2] setShardVersion success: { oldVersion:
Timestamp 0|0, ok: 1.0 }
Tue Feb 7 10:15:35 [conn2] ERROR: sharded m/r failed on shard:
shard1/cid:27017,cid:27018 error: { assertion: "assertion
db/commands/../../util/net/../../db/../bson/bson-inl.h:184", errmsg: "db
assertion failure", ok: 0.0 }
Tue Feb 7 10:21:01 [conn2] ERROR: sharded m/r failed on shard:
shard2/cid:27020,cid:27021 error: { assertion: "assertion
db/commands/../../util/net/../../db/../bson/bson-inl.h:184", errmsg: "db
assertion failure", ok: 0.0 }
Tue Feb 7 10:21:01 [conn2] end connection 127.0.0.1:46513
bson/bson-inl.h:184 is `assert( isABSONObj() );`
Any idea what's causing this?
--
George Macon
Georgia Tech Research Institute
Cyber Technology and Information Security Laboratory
404-407-8185
> Did you properly set --keyFile option on every single machine (mongos,
> all mongods, configs)?
>
Yes. (For testing, I'm running this all in one machine.)
/etc/mongodb$ grep keyFile *.conf ../mongos.conf
cs-1.conf:keyFile = /etc/mongodb/key
cs-2.conf:keyFile = /etc/mongodb/key
cs-3.conf:keyFile = /etc/mongodb/key
shard1-arbiter.conf:keyFile = /etc/mongodb/key
shard1-replica1.conf:keyFile = /etc/mongodb/key
shard1-replica2.conf:keyFile = /etc/mongodb/key
shard2-arbiter.conf:keyFile = /etc/mongodb/key
shard2-replica1.conf:keyFile = /etc/mongodb/key
shard2-replica2.conf:keyFile = /etc/mongodb/key
../mongos.conf:keyFile=/etc/mongodb/key
/etc/mongodb$
mongos> db.printShardingStatus()
--- Sharding Status ---
sharding version: { "_id" : 1, "version" : 3 }
shards:
{ "_id" : "shard1", "host" : "shard1/cid:27017,cid:27018" }
{ "_id" : "shard2", "host" : "shard2/cid:27020,cid:27021" }
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "test", "partitioned" : true, "primary" : "shard2" }
test.phrases chunks:
shard1 16
shard2 18
too many chunks to print, use verbose if you want to force
print