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

$group with allowDiskUse doesn't clean up _tmp files

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.0, 5.0.2, 6.1.0-rc0
    • 5.0.12, 6.1.0-rc0
    • None
    • 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

    Description

      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
          })
      }
      

      Attachments

        Activity

          People

            alberto.massari@mongodb.com Alberto Massari
            bruce.lucas@mongodb.com Bruce Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            18 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: