我有一个分片的Mongo 2.4.3设置。
当我尝试在我的某个集合上运行查询时,会收到错误消息exception: BSONObj size: 0 (0x00000000) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO
我已经运行了db.repairDatabase
,但似乎没有什么帮助。
当我只做 db.collection.findOne()
时,运行正常,但是当我例如进行 db.collection.find({'_id': {'$gte': ObjectId("52631d000000000000000000")}}
这样的操作时,就会出现上述错误。
我已经读到这可能是由于损坏的索引导致的,所以我尝试过:
db.collection.reIndex();
{
"raw" : {
"rs0/ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com:27017,ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com:27017,ec2-xx-xx-xxx-xx.us-west-2.compute.amazonaws.com:27017" : {
"nIndexesWas" : 2,
"errmsg" : "exception: BSONObj size: 0 (0x00000000) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO",
"code" : 10334,
"ok" : 0
}
},
"ok" : 0,
"errmsg" : "{ rs0/ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com:27017,ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com:27017,ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com:27017: \"exception: BSONObj size: 0 (0x00000000) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO\" }"
}
在执行此操作之前,我已删除了所有索引,仅保留了 _id 上的索引。
db.collection.getIndexes();
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "db.collection",
"name" : "_id_"
}
]
我还没有运气,而且我已经没有更多的想法了。有人有其他的建议吗?这个集合大约有9亿个文档,所以我真的需要恢复它。