[SERVER-58728] mqlrun does not support spilling to disk for $setWindowFields Created: 21/Jul/21  Updated: 09/Sep/21  Resolved: 09/Sep/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thomas Zembowicz Assignee: Ted Tuckman
Resolution: Won't Fix Votes: 0
Labels: query-director-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
is related to SERVER-58877 Ban spilling to disk in SpillableCach... Closed
Operating System: ALL
Steps To Reproduce:

Build or download an mqlrun binary (version 5.0.0). Prepare a large (at least 1 million docs) BSON file to use as an input (I can provide the one I used to reproduce this issue).

Start mqlrun from the command line (where ./tmp is a directory for spilling-to-disk): 

./mqlrun -f -j -t ./tmp -e '[{$_internalSetWindowFields: {output: {}}}]' big_1000000.bson > output.json

 This always causes mqlrun to crash with a SIGABRT:

[1] 78171 abort ./mqlrun -f -j -t ./tmp -e big_1000000.bson > output.json

The mqlrun process also writes the following to the tail end of the JSON output file:

{"t":{"$date":"2021-07-20T17:33:45.472Z"},"s":"F", "c":"-", "id":23079, "ctx":"thread1","msg":"Invariant failure","attr":{"expr":"Hit a MONGO_UNREACHABLE!","file":"src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h","line":271}}
{"t":{"$date":"2021-07-20T17:33:45.473Z"},"s":"F", "c":"-", "id":23080, "ctx":"thread1","msg":"\n\n***aborting after invariant() failure\n\n"}

However, when I run mqlrun with a $limit stage preceding the $_internalSetWindowFields stage:

./mqlrun -f -j -t ./tmp -e '[{$limit: 100000}, {$_internalSetWindowFields: {output: {}}}]' big_1000000.bson > output.json 

then mqlrun runs successfully for limits as high as 100,000. I've tried this with several large files and there's always some point after which mqlrun consistently fails with this same error. I've been unable to reproduce this with $sort or $group. I imported the contents of this file into MongoDB using mongorestore and am able to run a $setWindowFields aggregations without any errors.

Sprint: QO 2021-09-20
Participants:

 Description   

Running mqlrun (version 5.0.0) with $setWindowFields or $_internalSetWindowFields consistently triggers the following invariant on input data sets over a certain size (but never fails on smaller input sizes):

{"t":{"$date":"2021-07-20T17:33:45.472Z"},"s":"F", "c":"-", "id":23079, "ctx":"thread1","msg":"Invariant failure","attr":{"expr":"Hit a MONGO_UNREACHABLE!","file":"src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h","line":271}} {"t":{"$date":"2021-07-20T17:33:45.473Z"},"s":"F", "c":"-", "id":23080, "ctx":"thread1","msg":"\n\n***aborting after invariant() failure\n\n"}



 Comments   
Comment by Githook User [ 09/Sep/21 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-58728 Build MongoProcessInterface into mqlrun
Branch: SERVER-58728-mqlrun-storage
https://github.com/10gen/mongo-enterprise-modules/commit/7fafdcb0d2563d409dcf12f40bc217aefb9ee668

Comment by Andres Navarro [ 20/Aug/21 ]

Is there an ETA for when this fix will be released?

Comment by Thomas Zembowicz [ 21/Jul/21 ]

Discussed offline, I've included the only lines logged by mqlrun (besides documents!) in the steps to reproduce.

Comment by Charlie Swanson [ 21/Jul/21 ]

thomas.zembowicz could you include the whole backtrace after the invariant failure?

Generated at Thu Feb 08 05:45:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.