Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12687

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.4.9, 2.5.5
    • Shell
    • None
    • ALL
    • Hide

      See description

      Show
      See description

    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.

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: