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

Aggregation can trip invariant related to renamed fields optimization

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 3.6.2
    • Fix Version/s: 3.6.3, 3.7.2
    • Labels:
      None
    • Environment:
      Ubuntu 16.04.3 LTS
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Steps To Reproduce:
      Hide

      Include these stages in the db.collection.aggregate method:

      1. Project a new field. The new field name should include a colon
      2. Project the new field onto itself, as well as onto a second new field. The second new field can have any name
      3. Perform a match on the second new field.

      Example:

      db.getCollection('archiveData').aggregate([
          {
              "$project": {
                  "foo:bar": "$foo",
              }
          }, {
              "$project": {
                  "foo:bar": "$foo:bar",
                  "baz": "$foo:bar",
              }
          }, {
              "$match": {
                  "baz": 1
              }
          }
      ])
      

      Show
      Include these stages in the db.collection.aggregate method: Project a new field. The new field name should include a colon Project the new field onto itself, as well as onto a second new field. The second new field can have any name Perform a match on the second new field. Example: db.getCollection( 'archiveData' ).aggregate([ { "$project" : { "foo:bar" : "$foo" , } }, { "$project" : { "foo:bar" : "$foo:bar" , "baz" : "$foo:bar" , } }, { "$match" : { "baz" : 1 } } ])
    • Sprint:
      Query 2018-01-29

      Description

      Running certain db.collection.aggregate commands causes the mongod process to crash. Specifically, the crash seems to occur when field names contain a colon (:).

      Error output:

      2018-01-12T22:08:04.272+0000 E QUERY    [thread1] Error: error doing query: failed: network error while attempting to run command 'aggregate' on host '127.0.0.1:27017'  :
      DB.prototype.runCommand@src/mongo/shell/db.js:168:1
      DB.prototype.runReadCommand@src/mongo/shell/db.js:139:16
      DB.prototype._runAggregate/doAgg<@src/mongo/shell/db.js:239:60
      DB.prototype._runAggregate@src/mongo/shell/db.js:242:21
      DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1212:12
      @(shell):1:1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.storch David Storch
              Reporter:
              Aidan SE Mahler Aidan SE Mahler [X]
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: