creating index on a collection named "oplog" creates spurious collections

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.4.9, 2.5.5
    • Component/s: Shell
    • None
    • ALL
    • Hide

      See description

      Show
      See description
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Geert Bosch
            Reporter:
            Thomas Rueckstiess (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: