Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.4.9, 2.5.5
-
None
-
ALL
-
Description
Creating an index on a collection named oplog will create a spurious collection with the name of the index.
Here the shell transcript of a fresh mongod node:
$ mongo
|
MongoDB shell version: 2.5.5
|
connecting to: test
|
Server has startup warnings:
|
2014-02-12T16:54:46.726+1100 [initandlisten]
|
2014-02-12T16:54:46.727+1100 [initandlisten] ** NOTE: This is a development version (2.5.5) of MongoDB.
|
2014-02-12T16:54:46.727+1100 [initandlisten] ** Not recommended for production.
|
2014-02-12T16:54:46.727+1100 [initandlisten]
|
> show collections
|
> db.oplog.ensureIndex({foo:1, bar:1})
|
> show collections
|
oplog
|
oplog.$_id_
|
oplog.$foo_1_bar_1
|
system.indexes
|
>
|
Querying that spurious collection generates a BSONObj size error.
> db.getCollection('oplog.$foo_1_bar_1').find()
|
error: {
|
"$err" : "BSONObj size: -2 (0xFFFFFFFE) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO",
|
"code" : 10334
|
}
|
Other collection names, including oplog_foo, oplog.rs, foo_oplog don't show this behavior.