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

Stage $sample requires sort option allowDiskUse:true

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.1.8
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Just tried to run

      { aggregate: "bigarray", pipeline: [ { $sample: { size: 1000 } } ], cursor: {} }
      

      and got error:

      Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.
      

      It's not clear why aggregation sorting is involved in $sample - if that's expected it needs to be prominently documented, but if it shouldn't be using sort then this is a bug.

            Assignee:
            Unassigned Unassigned
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None