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

CollectionOptions parser should skip "size"/"max" elements if values non-numeric

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.4.10
    • 2.6.2, 2.7.1
    • Storage
    • None
    • Server 2.7.1

    Description

      Issue Status as of May 14, 2014

      ISSUE SUMMARY
      Prior to version 2.4.4 (and 2.2.5 in the 2.2 cycle), a call to db.createCollection() would set certain collection options to a null value rather than omitting them if they were not explicitly set by the user (see SERVER-6947 for details). Version 2.4 of the server ignored these null values, but 2.6 fails with an error message upon encountering them. This may cause problems when making copies of collections using a 2.6 server; affected commands include cloneCollection and repairDatabase.

      To verify if a collection is affected by this issue, inspect the system.namespaces collection of each database for any documents that have null values for options.size or options.max fields. Here is an example that shows an affected collection "test.foo":

      > db.system.namespaces.find()
      { "name" : "test.system.indexes" }
      { "name" : "test.foo.$_id_" }
      { "name" : "test.foo", "options" : { "create" : "foo", "capped" : null, "size" : null } }

      USER IMPACT
      Operations that copy collections fail with an error message.

      WORKAROUNDS
      N/A

      AFFECTED VERSIONS
      MongoDB production releases 2.6.0 and 2.6.1 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.2 production release.

      RESOLUTION DETAILS
      The procedure that parses collection options ignores values for size and max if they are non-numeric, rather than returning an error and aborting the command.

      Original description

      When attempting to clone collection from live at version 2.4.3 to dev at version 2.6.0 recieved error.

      shard2:PRIMARY> db.runCommand(

      {cloneCollection:"homescom_reporting.realmedia_campaign_daily_sum",from:"mongodb11.dc3.homes.com:27017"}

      );

      { "ok" : 0, "errmsg" : "BadValue size has to be a number" }

      Is this a cross version issue or is there a problem cloneCollection in 2.6?

      Attachments

        Issue Links

          Activity

            People

              rassi J Rassi
              robert.jobson@dominionenterprises.com Robert Jobson
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: