$group with allowDiskUse doesn't clean up _tmp files

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v5.0
    • QE 2022-05-16, QE 2022-05-30, QE 2022-06-13, QE 2022-06-27, QE 2022-07-11, QE 2022-07-25
    • 60
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      UPDATE: There's a dedicated test in master branch group_tmp_file_cleanup.js, however, it starts to fail only with memoryLimitMb >= 15.

      This seems to be a fairly general issue, because the following simple test reproduces the problem:

      function repro() {
      
          db.c.drop()
      
          print("inserting")
          doc = {x: "x".repeat(1000)}
          many = Array(1000).fill(doc)
          for (var i = 0; i < 100; i++)
              db.c.insertMany(many)
      
          print("aggregating")
          r = db.c.aggregate([
              {
                  $group: {
                      "_id": "$_id",
                      x: {$push: "$x"},
                  }
              }
          ], {
              allowDiskUse: true
          })
      }
      

            Assignee:
            Alberto Massari
            Reporter:
            Bruce Lucas (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: