[SERVER-44945] aggregate failed at assertion src\\mongo\\db\\pipeline\\value.cpp:1365 Created: 04/Dec/19  Updated: 09/Dec/19  Resolved: 09/Dec/19

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

Type: Bug Priority: Major - P3
Reporter: chris li Assignee: Carl Champain (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-43151 Error in aggregation assertion at val... Closed
Operating System: ALL
Participants:

 Description   

my query:

db.transactions.aggregate([{$group:{_id:{hash:"$hash"},count:{$sum:1}}},{$match:{count:{$gt:1}}}],{allowDiskUse:true})

I use this query to find duplicates of hash field, but every time I get  below error msg when I execute this query. this transaction collection contain 0.5 billion documents, so it takes a while to aggregate, which it's totally understandable, but getting error msg is something I didn't understand. because I execute the same query at another smaller transaction collection in another database where it contain just maybe tens of thousands of documents, and it worked. but for 0.5 billion documents collection, it doesn't work. 

error msg:

uncaught exception: Error: command failed: {
 "ok" : 0,
 "errmsg" : "assertion src\\mongo\\db\\pipeline\\value.cpp:1365",
 "code" : 8,
 "codeName" : "UnknownError"
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:583:17
assert.commandWorked@src/mongo/shell/assert.js:673:16
DB.prototype._runAggregate@src/mongo/shell/db.js:266:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1012:12
@(shell):1:1



 Comments   
Comment by Carl Champain (Inactive) [ 09/Dec/19 ]

liqy0906@gmail.com,

After further investigation, we think that this ticket is a duplicate of SERVER-43151, which is now closed and has a fix for several versions. I recommend you upgrading to the appropriate one:

  • Fix in already available releases 4.3.1 and 4.2.2
  • Fix in upcoming releases 3.6.17, 3.4.24 and 4.0.14

I'm going to close this ticket, but if after upgrading you continue to experience this issue, please provide the requested information above, and I will reopen the ticket.

Thank you,
Carl

Comment by Carl Champain (Inactive) [ 04/Dec/19 ]

Hi liqy0906@gmail.com,

Thanks for the report.
To help us understand what is happening, can you please provide:

  1. The collection stats: db.transactions.stats() ?
  2. The index information: db.transactions.getIndexes() ?
  3. The explain() output for this query: db.transactions.explain().aggregate([...])
  4. The mongod.log file for this node?

Kind Regards,
Carl

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